forked from cyclic-software/starter-react-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
23 lines (19 loc) · 636 Bytes
/
server.js
File metadata and controls
23 lines (19 loc) · 636 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const express = require('express')
const path = require("path");
const app = express()
// #############################################################################
// This configures static hosting for files in /public that have the extensions
// listed in the array.
var options = {
dotfiles: 'ignore',
etag: false,
extensions: ['htm', 'html','css','js','ico','jpg','jpeg','png','svg'],
index: ['index.html'],
maxAge: '1m',
redirect: false
}
app.use(express.static('build', options))
const port = process.env.PORT || 3000
app.listen(port, () => {
console.log(`React app listening at http://localhost:${port}`)
})