I have a route in mock-server like this: http://localhost:1337/mock-store/admin/store-parameters/1 which returns back a json:
{
"id": 1,
"code": "123",
"redirect": true
}
I want that if the json includes "redirect = true", the route will redirect me to a different link.
I'm trying to use middleware.js inside my yotpo-mock server, for example:
module.exports = (req, res, next) => {
req.header('X-Hello', 'Goodbye');
res.header('X-Hello', 'World');
next("www.google.com)
}
but the json response simply changed to "google.com". I want my route to be redirected to google.com.
HELP?