29 lines
610 B
JavaScript
29 lines
610 B
JavaScript
const express = require("express");
|
|
const app = express();
|
|
const he = require("he");
|
|
|
|
app.get("/", (req, res) => {
|
|
const { previous, lang, token } = req.query;
|
|
getServiceStatus((status) => {
|
|
const href = he.encode(`${previous}${token}/${lang}`);
|
|
res.send(`
|
|
<h1>Service Status</h1>
|
|
<div id=status>
|
|
${status}
|
|
</div>
|
|
<div>
|
|
<a href="${href}">Back</a>
|
|
</div>
|
|
`);
|
|
});
|
|
});
|
|
|
|
getServiceStatus = (callback) => {
|
|
const status = "All systems are running.";
|
|
callback(status);
|
|
};
|
|
|
|
app.listen(3000, () => {
|
|
console.log("Server listening on port 3000");
|
|
});
|