- Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathserver.js
More file actions
Latest commit
19 lines (12 loc) · 540 Bytes
/
Copy pathserver.js
File metadata and controls
19 lines (12 loc) · 540 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
letexpress=require('express')
letapp=express()
letreloadMagic=require('./reload-magic.js')
reloadMagic(app)
app.use('/',express.static('build'));// Needed for the HTML and JS files
app.use('/',express.static('public'));// Needed for local assets
// Your endpoints go after this line
// Your endpoints go before this line
app.all('/*',(req,res,next)=>{// needed for react router
res.sendFile(__dirname+'/build/index.html');
})
app.listen(4000,'0.0.0.0',()=>{console.log("Server running on port 4000")})