Created
June 10, 2020 16:49
-
-
Save moaoa/e9dd2f8569601639770e3a6d9c319966 to your computer and use it in GitHub Desktop.
This file contains 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 app = express() | |
const path = require('path') | |
app.use(express.static('client/build')) | |
app.get('*', (req, res) => { | |
const filePath = path.join(__dirname, 'client', 'build', 'index.html') | |
res.sendFile(filePath) | |
}) | |
app.listen(process.env.PORT || 5000, () => console.log('connected')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment