faq-website/server.js

16 lines
471 B
JavaScript
Raw Permalink Normal View History

2024-07-06 01:08:38 +00:00
import express from "express";
import faqRouter from "./routes/index.js";
const app = express();
app.use(faqRouter);
2024-07-06 01:14:20 +00:00
var listenPort = parseInt(process.env.PORT) || 3919;
var listenHost = process.env.HOST || "127.0.0.1";
if (listenHost[0] != "/") {
app.listen(listenPort, listenHost, () => {
console.log(`Listening on ${listenHost}:${listenPort}`);
});
} else {
app.listen(listenHost, () => {
console.log(`Listening on ${listenHost} (unix socket)`);
});
2024-07-06 01:08:38 +00:00
}