Last active
November 4, 2016 07:02
-
-
Save ooade/8fe0eb41b0d9fbe0f99dfb1603515296 to your computer and use it in GitHub Desktop.
Express with webpack production ready
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 PORT = process.env.PORT || 3000; | |
// Initialize express | |
const app = express(); | |
// Serve the build file | |
app.use('/', express.static(process.cwd() + '/build')); | |
// Start up our express server | |
app.listen(PORT, (error) => { | |
if (error) throw error; | |
console.log('Production server listening on port', PORT); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment