Created
November 8, 2019 12:10
-
-
Save RomaSto/e9cb8235ba481b995de7efe45b15f9ff to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const path = require('path'); | |
const port = process.env.PORT || 7096; | |
const app = express(); | |
app.use(express.static(`${__dirname}/build`)); | |
app.get('*', (request, response) => { | |
response.sendFile(path.resolve(__dirname, 'build/index.html')); | |
}); | |
app.listen(port); | |
console.log(`server started on port ${port}`); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment