Skip to content

Commit adc421d

Browse files
amazingshellyyyamazingandyyy
authored andcommitted
fix: make sure server work
1 parent 05c97e7 commit adc421d

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,16 @@ $ npm run deploy:heroku
9494

9595
### After creating heroku
9696

97+
if using webpack:
9798
remember to update the file of [client/webpack.prod.js](https://github.com/amazingandyyy/mern/blob/master/client/webpack.prod.js)
9899
```javascript
99100
'API_URI': JSON.stringify('https://your-super-amazing-heroku-app.herokuapp.com')
100101
```
101-
102+
if using parcel
103+
remember to update the file of [client/.env.production](https://github.com/amazingandyyy/mern/blob/master/client/.env.production.js)
104+
```
105+
REACT_APP_API_URI=https://your-super-amazing-heroku-app.herokuapp.com
106+
```
102107
# Dependencies(tech-stacks)
103108
Client-side | Server-side
104109
--- | ---

client/.env.production

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
REACT_APP_API_URI=https://mern-amazingandyyy.herokuapp.com
2+
NODE_ENV=production

server/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ mongoose.Promise = global.Promise;
2323

2424
// App Setup
2525
app.use(cors({
26-
origin: ['https://www.amazingandyyy.com', 'http://localhost:3000']
26+
origin: ['https://www.amazingandyyy.com', 'http://localhost:3000', 'http://localhost:1234']
2727
}));
2828
app.use(morgan('dev'));
2929
app.use(express.json())

0 commit comments

Comments
 (0)