Skip to content

Instantly share code, notes, and snippets.

@joshtrigger
Last active April 11, 2020 00:15
Show Gist options
  • Save joshtrigger/b4d8e4d53cb6ad54f49c4cdf245ad946 to your computer and use it in GitHub Desktop.
Save joshtrigger/b4d8e4d53cb6ad54f49c4cdf245ad946 to your computer and use it in GitHub Desktop.
const express = require('express');
const app = express();
const path = require('path');
app.use(express.static(__dirname + '/dist/<app-name>'));
app.get('*', (req, res) => {
res.sendFile(path.join(__dirname + '/dist/<app-name>/index.html'));
});
app.listen(process.env.PORT || 5000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment