added __heartbeat__

This commit is contained in:
Danny Coates 2017-06-23 11:14:33 -07:00
parent 2691dfcf2f
commit d247e0ba31
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
2 changed files with 31 additions and 8 deletions

View file

@ -16,10 +16,13 @@ const log = mozlog('portal.server');
const app = express();
app.engine('handlebars', exphbs({
defaultLayout: 'main',
partialsDir: 'views/partials/'
}));
app.engine(
'handlebars',
exphbs({
defaultLayout: 'main',
partialsDir: 'views/partials/'
})
);
app.set('view engine', 'handlebars');
app.use(helmet());
@ -27,7 +30,6 @@ app.use(busboy());
app.use(bodyParser.json());
app.use(express.static(path.join(__dirname, '../public')));
app.get('/', (req, res) => {
res.render('index', {
shouldRenderAnalytics: notLocalHost,
@ -150,6 +152,10 @@ app.get('/__lbheartbeat__', (req, res) => {
res.sendStatus(200);
});
app.get('/__heartbeat__', (req, res) => {
storage.ping().then(() => res.sendStatus(200), () => res.sendStatus(500));
});
app.listen(conf.listen_port, () => {
log.info('startServer:', `Portal app listening on port ${conf.listen_port}!`);
});