feat: option to configure host for server

This commit is contained in:
Vjacheslav Trushkin 2022-10-14 17:25:54 +03:00
parent c577df4f98
commit 985db94876
3 changed files with 7 additions and 3 deletions

View File

@ -25,8 +25,8 @@ export const appConfig: AppConfig = {
'Cache-Control: public, max-age=604800, min-refresh=604800',
],
// Port
// To set custom options for listener, such as IP address, edit `src/http/index.ts`
// Host and port for server
host: '0.0.0.0',
port: 3000,
// Log stuff

View File

@ -135,8 +135,9 @@ export async function startHTTPServer() {
});
// Start it
console.log('Listening on port', appConfig.port);
console.log('Listening on', appConfig.host + ':' + appConfig.port);
server.listen({
host: appConfig.host,
port: appConfig.port,
});
}

View File

@ -15,6 +15,9 @@ export interface AppConfig {
// HTTP headers to send
headers: string[];
// Host
host: string;
// Port
port: number;