fix(server): handle number port (#692)

This commit is contained in:
Trim21
2023-12-06 20:06:15 +08:00
committed by GitHub
parent a570469756
commit 1362a35f1f
+2 -2
View File
@@ -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}`);