diff options
Diffstat (limited to 'netlify')
| -rw-r--r-- | netlify/edge-functions/rewrite.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/netlify/edge-functions/rewrite.js b/netlify/edge-functions/rewrite.js new file mode 100644 index 0000000..5f216f3 --- /dev/null +++ b/netlify/edge-functions/rewrite.js @@ -0,0 +1,10 @@ +const rewrite = async (request, context) => { + const path = context.geo?.country?.code === 'AU' ? '/edge/australia' : '/edge/not-australia'; + return new URL(path, request.url); +}; + +export const config = { + path: '/edge' +}; + +export default rewrite; |
