2018-03-28 16:26:59 +02:00
|
|
|
// server.js
|
|
|
|
|
2018-03-29 08:24:59 +02:00
|
|
|
var sslRedirect = require('heroku-ssl-redirect');
|
2018-03-28 16:26:59 +02:00
|
|
|
var express = require('express');
|
|
|
|
var path = require('path');
|
|
|
|
var serveStatic = require('serve-static');
|
|
|
|
|
|
|
|
app = express();
|
|
|
|
app.use(serveStatic(__dirname + "/dist"));
|
|
|
|
|
2018-03-29 08:24:59 +02:00
|
|
|
// enable ssl redirect
|
2018-03-29 08:28:54 +02:00
|
|
|
app.use(sslRedirect(['other','development', 'staging', 'production']));
|
2018-03-29 08:24:59 +02:00
|
|
|
|
|
|
|
var port = process.env.PORT || 8080;
|
2018-03-28 16:26:59 +02:00
|
|
|
app.listen(port);
|
|
|
|
|
|
|
|
console.log('server started '+ port);
|