Added middleware for docker.

This commit is contained in:
Mike Cao 2023-04-19 08:49:16 -07:00
parent 3eabe9b958
commit ac8d8bbd1e
4 changed files with 59 additions and 1 deletions

View file

@ -44,6 +44,17 @@ if (process.env.COLLECT_API_ENDPOINT) {
});
}
if (process.env.TRACKER_SCRIPT_NAME) {
const match = process.env.TRACKER_SCRIPT_NAME?.match(/\/?(\w+)(\.js)?/);
if (match) {
rewrites.push({
source: `/${match[0]}.js`,
destination: '/script.js',
});
}
}
const redirects = [];
if (process.env.CLOUD_MODE) {