UNPKG

ts-mean

Version:

Boilerplate for a TS-MEAN App

21 lines (14 loc) 506 B
// Run this with ts-node (https://github.com/TypeStrong/ts-node) const express = require('express'); const path = require('path'); const server = express(); const distPath = path.join(__dirname, '/dist'); server.use(express.static(distPath)); // redirect everything to index server.get('*', (req, res) => { res.status(200).sendFile(path.join(distPath, 'index.html')); }); const port = process.argv[2] || 4243; server.listen(port, function() { console.log('server listening on port ' + port); });