Skip to content

Instantly share code, notes, and snippets.

@jkasun
Created August 25, 2018 18:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkasun/b18ab409beea43d36f1458a10abcbcb2 to your computer and use it in GitHub Desktop.
Save jkasun/b18ab409beea43d36f1458a10abcbcb2 to your computer and use it in GitHub Desktop.
const path = require('path');
const express = require('express');
const app = express()
app.use('/public', express.static(__dirname + '/../app/public'));
app.get('/*', function (req, res) {
res.sendFile(path.join(__dirname + '/../app/index.html'));
});
app.listen(3000, () => {
console.log('Sample SPA is running on port 3000!');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment