podman-compose/examples/nodeproj/lib/commands/web.js

22 lines
534 B
JavaScript
Raw Normal View History

2022-03-18 16:05:57 +01:00
"use strict";
import {proj} from "../proj";
import http from "http";
import express from "express";
export async function start() {
const app = express();
const server = http.createServer(app);
// Routing
app.use(express.static(proj.config.basedir + "/public"));
app.get("/healthz", function(req, res) {
res.send("ok@"+Date.now());
});
server.listen(proj.config.LISTEN_PORT, proj.config.LISTEN_HOST, function() {
2022-03-18 16:29:27 +01:00
console.warn(`listening at port ${proj.config.LISTEN_PORT}`);
2022-03-18 16:05:57 +01:00
});
}