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', 'Cache-Control: public, max-age=604800, min-refresh=604800',
], ],
// Port // Host and port for server
// To set custom options for listener, such as IP address, edit `src/http/index.ts` host: '0.0.0.0',
port: 3000, port: 3000,
// Log stuff // Log stuff

View File

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

View File

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