Skip to content

Commit

Permalink
fix: make sure server work
Browse files Browse the repository at this point in the history
  • Loading branch information
amazingshellyyy authored and amazingandyyy committed Dec 22, 2022
1 parent 05c97e7 commit adc421d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,16 @@ $ npm run deploy:heroku

### After creating heroku

if using webpack:
remember to update the file of [client/webpack.prod.js](https://github.com/amazingandyyy/mern/blob/master/client/webpack.prod.js)
```javascript
'API_URI': JSON.stringify('https://your-super-amazing-heroku-app.herokuapp.com')
```

if using parcel
remember to update the file of [client/.env.production](https://github.com/amazingandyyy/mern/blob/master/client/.env.production.js)
```
REACT_APP_API_URI=https://your-super-amazing-heroku-app.herokuapp.com
```
# Dependencies(tech-stacks)
Client-side | Server-side
--- | ---
Expand Down
2 changes: 2 additions & 0 deletions client/.env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
REACT_APP_API_URI=https://mern-amazingandyyy.herokuapp.com
NODE_ENV=production
2 changes: 1 addition & 1 deletion server/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ mongoose.Promise = global.Promise;

// App Setup
app.use(cors({
origin: ['https://www.amazingandyyy.com', 'http://localhost:3000']
origin: ['https://www.amazingandyyy.com', 'http://localhost:3000', 'http://localhost:1234']
}));
app.use(morgan('dev'));
app.use(express.json())
Expand Down

0 comments on commit adc421d

Please sign in to comment.