From 2a3e2af528e492f587de561988100ada6efb2050 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Sun, 7 Apr 2024 23:48:47 +0800 Subject: [PATCH] fix: fix custom tracker script file route error in production --- .gitignore | 2 +- src/server/app.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 436c399..5c018da 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ .env -public/tracker.js +src/client/public/tracker.js geo # Logs diff --git a/src/server/app.ts b/src/server/app.ts index cf735af..b0434c9 100644 --- a/src/server/app.ts +++ b/src/server/app.ts @@ -50,7 +50,7 @@ app.use('/trpc', trpcExpressMiddleware); if (env.customTrackerScriptName) { app.get(`/${env.customTrackerScriptName}`, (req, res) => - res.sendFile(path.resolve(__dirname, './public/tracker.js')) + res.sendFile(path.resolve(process.cwd(), './public/tracker.js')) ); }