fix(server): bind entrypoint on Windows

The guard compared import.meta.url against 'file://'+argv[1], which never matched on Windows (mismatched slashes and drive prefix), so the process started without ever calling app.listen(). Compare import.meta.filename to argv[1] instead.
This commit is contained in:
tiennm99 committed 2026-07-24 23:34:25 +07:00
1 parent 376a7ae688
commit f053682f84
1 file changed
+1 -1
+1 -1
View File
@@ -45,7 +45,7 @@ export const buildServer = async (options = {}) => {
return app;
};
if (import.meta.url === `file://${process.argv[1]}`) {
if (import.meta.filename === process.argv[1]) {
const config = loadConfig();
const app = await buildServer({config});
await app.listen({host: config.host, port: config.port});