mirror of
https://github.com/zoriya/flood.git
synced 2026-06-02 11:06:35 +00:00
fix(server): handle number port (#692)
This commit is contained in:
@@ -40,10 +40,10 @@ const startWebServer = async () => {
|
||||
|
||||
await constructRoutes(instance as FastifyInstance);
|
||||
|
||||
if (typeof port === 'string') {
|
||||
if (typeof port === 'string' && !/^\d+$/.test(port)) {
|
||||
await instance.listen({path: port});
|
||||
} else {
|
||||
await instance.listen({port, host});
|
||||
await instance.listen({port: Number(port), host});
|
||||
}
|
||||
const address = chalk.underline(`${ssl ? 'https' : 'http'}://${host}:${port}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user