Skip to content

Instantly share code, notes, and snippets.

View coderbag's full-sized avatar
🎯
Focusing

coderbag

🎯
Focusing
View GitHub Profile
@coderbag
coderbag / server.js
Created May 10, 2018 19:31
Heroku Node Server
const express = require('express');
const path = require('path');
const app = express();
// Run the app by serving the static files
// in the dist directory
app.use(express.static(__dirname + '/dist'));
// For all GET requests, send back index.html
// so that PathLocationStrategy can be used
app.get('/*', function(req, res) {
res.sendFile(path.join(__dirname + '/dist/index.html'));