Debian Codegraph @

examples/nodeproj/lib/commands/web.js

raw symbols SCIP
1 "use strict";
2 import {proj} from "../proj";
3
4 import http from "http";
5 import express from "express";
6
7
8 export async function start() {
9 const app = express();
10 const server = http.createServer(app);
11
12 // Routing
13 app.use(express.static(proj.config.basedir + "/public"));
14 app.get("/healthz", function(req, res) {
15 res.send("ok@"+Date.now());
16 });
17
18 server.listen(proj.config.LISTEN_PORT, proj.config.LISTEN_HOST, function() {
19 console.warn(`listening at port ${proj.config.LISTEN_PORT}`);
20 });
21 }