0

Using fastify library I want to be redirected to a web-page. Looking at all the examples in docs, it seems like it covers only route-to-route redirection.

Link to redirect docs

fastify.post('/v1/launch', async (req, res) => {
  response.redirect('/empty-cart');
});

The code above results in 404 error trying to find that route.

result

But how it can be redirected to external page? Thanks!

Update: Trying to redirect to https://my-domain.com/empty-cart

result2

with ERR_NAME_NOT_RESOLVED error

poltorin
  • 219
  • 1
  • 3
  • 12

1 Answers1

1

Please try

response.redirect('https://stackoverflow.com/')
Dharman
  • 26,923
  • 21
  • 73
  • 125
Eanthmue
  • 455
  • 2
  • 5