feat(assist): health check endpoint

This commit is contained in:
Taha Yassine Kraiem 2022-09-19 12:29:12 +01:00
parent b211a3eab9
commit a7a728f88a
2 changed files with 3 additions and 2 deletions

View file

@ -20,7 +20,7 @@ if (process.env.uws !== "true") {
wsapp.use(express.json());
wsapp.use(express.urlencoded({extended: true}));
wsapp.use(request_logger("[wsapp]"));
wsapp.get([PREFIX, `${PREFIX}/`, `${PREFIX}/${P_KEY}`, `${PREFIX}/${P_KEY}/`], (req, res) => {
wsapp.get(['/', PREFIX, `${PREFIX}/`, `${PREFIX}/${P_KEY}`, `${PREFIX}/${P_KEY}/`], (req, res) => {
res.statusCode = 200;
res.end("ok!");
}
@ -45,6 +45,7 @@ if (process.env.uws !== "true") {
const healthFn = (res, req) => {
res.writeStatus('200 OK').end('ok!');
}
uapp.get('/', healthFn);
uapp.get(PREFIX, healthFn);
uapp.get(`${PREFIX}/`, healthFn);
uapp.get(`${PREFIX}/${P_KEY}`, healthFn);

View file

@ -14,7 +14,7 @@ wsapp.use(express.json());
wsapp.use(express.urlencoded({extended: true}));
wsapp.use(request_logger("[wsapp]"));
wsapp.get([PREFIX, `${PREFIX}/`, `${PREFIX}/${P_KEY}`, `${PREFIX}/${P_KEY}/`], (req, res) => {
wsapp.get(['/', PREFIX, `${PREFIX}/`, `${PREFIX}/${P_KEY}`, `${PREFIX}/${P_KEY}/`], (req, res) => {
res.statusCode = 200;
res.end("ok!");
}