Skip to content

Instantly share code, notes, and snippets.

@ooade
Last active November 4, 2016 07:02
Show Gist options
  • Save ooade/8fe0eb41b0d9fbe0f99dfb1603515296 to your computer and use it in GitHub Desktop.
Save ooade/8fe0eb41b0d9fbe0f99dfb1603515296 to your computer and use it in GitHub Desktop.
Express with webpack production ready
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