Add rudimentary command line parsing to express app
This commit is contained in:
@@ -3,6 +3,7 @@ import express, {
|
||||
Response as ExpressResponse,
|
||||
} from "express";
|
||||
import { match } from "path-to-regexp";
|
||||
import { cli } from "./cli";
|
||||
import { contentTypes } from "./content-types";
|
||||
import { httpCodes } from "./http-codes";
|
||||
import { routes } from "./routes";
|
||||
@@ -117,4 +118,6 @@ app.use(async (req: ExpressRequest, res: ExpressResponse) => {
|
||||
res.status(code).send(result);
|
||||
});
|
||||
|
||||
app.listen(3000);
|
||||
app.listen(cli.listen.port, cli.listen.host, () => {
|
||||
console.log(`Listening on ${cli.listen.host}:${cli.listen.port}`);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user