Added middleware for docker.

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

No files matched your search

+11
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) {