Skip to content

Instantly share code, notes, and snippets.

@hyperh
Created December 5, 2016 03:46
Show Gist options
  • Select an option

  • Save hyperh/5637e811a1ecc971af223480b31298b0 to your computer and use it in GitHub Desktop.

Select an option

Save hyperh/5637e811a1ecc971af223480b31298b0 to your computer and use it in GitHub Desktop.
import express from 'express';
import webpack from 'webpack';
import webpackConfig from '../webpack/webpack.config.dev-client';
const render = require('../dist/assets/SSR');
const app = express();
const compiler = webpack(webpackConfig);
app.use(require('webpack-dev-middleware')(compiler, {
noInfo: true,
publicPath: webpackConfig.output.publicPath,
}));
app.get('/', render.default);
const port = 3000;
app.listen(port);
console.log(`Listening on port ${port}`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment