fix: fix custom tracker script file route error in production

This commit is contained in:
moonrailgun 2024-04-07 23:48:47 +08:00
parent 5d8c18716a
commit 2a3e2af528
2 changed files with 2 additions and 2 deletions

2
.gitignore vendored
View File

@ -1,5 +1,5 @@
.env .env
public/tracker.js src/client/public/tracker.js
geo geo
# Logs # Logs

View File

@ -50,7 +50,7 @@ app.use('/trpc', trpcExpressMiddleware);
if (env.customTrackerScriptName) { if (env.customTrackerScriptName) {
app.get(`/${env.customTrackerScriptName}`, (req, res) => app.get(`/${env.customTrackerScriptName}`, (req, res) =>
res.sendFile(path.resolve(__dirname, './public/tracker.js')) res.sendFile(path.resolve(process.cwd(), './public/tracker.js'))
); );
} }