mirror of
https://github.com/tiennm99/tiennm99bot.git
synced 2026-10-11 03:13:46 +00:00
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:
1 parent
376a7ae688
commit
f053682f84
1 file changed
+1
-1
@@ -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});
|
||||
|
||||
Reference in new issue
Block a user