WaspW
Wasp2y ago
13 replies
KC

redirect incoming request to a path with a new header

Is there a way to redirect a request coming to a path like /blog*? I am trying to add an Astro blog to our app which will be on a different machine. So all requests to /blog need to be routed to the Astro machine. I am using Fly so there is an easy way to do this using the Fly-Replay header.


Here's the implementation in Express
app.all('/blog*', function replayToBlog(req, res) {
res.set('Fly-Replay', 'app=fly-replay-blog')
res.status(204).send('')
})
Was this page helpful?