Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
mkdir -p "build/${BASE_URL}"
mv build-raw/* "build/${BASE_URL}/"
rm -rf build-raw
cp "build/${BASE_URL}/404.html" build/404.html

- name: Generate cache headers
env:
Expand Down
4 changes: 4 additions & 0 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ const config = {
from: "/sheets/troubleshooting/common-error-messages",
to: "/sheets/troubleshooting",
},
{
from: "/api/universal-parameters/feed",
to: "/api/universal-parameters/mode",
},
],
},
],
Expand Down
10 changes: 9 additions & 1 deletion worker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,15 @@ async function handleRequest(request) {
for (const route of ROUTES) {
if (matchesRoute(url.pathname, route.prefix)) {
url.hostname = route.target;
return fetch(new Request(url, request), { cf: { cacheEverything: true } });
const response = await fetch(new Request(url, request), { cf: { cacheEverything: true } });

if (response.status === 404) {
const pathname = new URL(request.url).pathname;
const referer = request.headers.get('referer');
console.log({ level: '404', message: pathname, referer: referer || '' });
}

return response;
}
}

Expand Down
4 changes: 4 additions & 0 deletions worker/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ routes = [
{ pattern = "www.marketdata.app/docs", zone_name = "marketdata.app" },
{ pattern = "www.marketdata.app/docs/*", zone_name = "marketdata.app" },
]

[observability]
enabled = true
head_sampling_rate = 1