Created
October 12, 2016 02:59
-
-
Save dengjonathan/9523b60bcb61cdfadd22d7d9cd01aa63 to your computer and use it in GitHub Desktop.
Express Server for React project
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 path = require('path') | |
const express = require('express') | |
module.exports = { | |
app: function () { | |
const app = express(); | |
const indexPath = path.join(__dirname, 'indexDep.html'); | |
const publicPath = express.static(path.join(__dirname, '../dist')); | |
app.use('/dist', publicPath); | |
app.get('/', function (_, res) { res.sendFile(indexPath) }); | |
return app; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment