I want to set up a split test for my Layer0 environment using Router destinations. However I want to make sure traffic continues to hit a fallback route in the time period between deploying the router update and defining the split test rule utilizing the new destinations. I tried doing:
const appRouter = new Router();
appRouter.destination(
'nuxtApp',
new Router()
.get('/cutover', ({ renderWithApp }) => {
renderWithApp();
})
.fallback(({ proxy, cache }) => {
cache({
edge: false,
});
proxy('legacy');
})
);
appRouter.destination(
'legacyProxy',
new Router()
.fallback(({ proxy, cache }) => {
cache({
edge: false,
});
proxy('legacy');
})
);
appRouter.fallback(({ proxy, cache }) => {
cache({
edge: false,
});
proxy('legacy');
});
return appRouter;
My expectation is that when this is deployed, all traffic will be proxied to legacy since the destinations are not defined as part of a split test. However, the /nuxtPath
route in my first destination is being matched when this is deployed.
Is the expected behavior here for all routes to be matched when a destination is not specified?