feat: add tracker.js cache control

This commit is contained in:
moonrailgun 2023-10-24 00:01:03 +08:00
parent 31ba529022
commit 6f17859759

View File

@ -41,6 +41,13 @@ app.use(passport.initialize());
// http://expressjs.com/en/advanced/best-practice-security.html#at-a-minimum-disable-x-powered-by-header // http://expressjs.com/en/advanced/best-practice-security.html#at-a-minimum-disable-x-powered-by-header
app.disable('x-powered-by'); app.disable('x-powered-by');
app.use(
'/tracker.js',
express.static('./public/tracker.js', {
maxAge: '7d',
})
);
app.use('/api/website', websiteRouter); app.use('/api/website', websiteRouter);
app.use('/api/workspace', workspaceRouter); app.use('/api/workspace', workspaceRouter);
app.use('/telemetry', telemetryRouter); app.use('/telemetry', telemetryRouter);