L
L
LinuxGod2020-05-05 17:54:03
Express.js
LinuxGod, 2020-05-05 17:54:03

How to redirect all GET requests to another site?

How can I make expres execute res.redirect('completely different site') from all GET requests?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
anakondoz, 2020-05-05
@LinuxGod

app.get('*', function (req, res) {
    res.redirect('https://google.com')
})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question