forked from hub-dela/health-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
35 lines (28 loc) · 757 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const express = require("express");
const exphbs = require("express-handlebars");
const router = require("express-promise-router")();
const app = express();
var handlebars = exphbs.create({
defaultLayout: false
});
app.engine('.hbs', handlebars.engine);
app.set('view engine', '.hbs');
app.use(router);
router.get("/", index)
router.get("/health/live", live)
router.get("/health/ready", ready)
async function index(_req, res) {
return res.sendStatus(200);
}
async function live(_req, res) {
return res.sendStatus(200);
}
async function ready(_req, res) {
return res.sendStatus(200);
}
if (!module.parent) {
port = process.env.PORT || 4000;
app.listen(port);
console.log(`listening on port ${port}`)
}
module.exports = app;