How to use res.redirect in a webtask?

时间:2018-09-18 19:50:05

标签: webtask

I'm exporting an express app called eggman with webtask-tools.

My res.redirect('/walrus')ses don't work.

The url for my app is ….sandbox.auth0-extend.com/eggman/walrus, which means / will point to ….sandbox.auth0-extend.com/walrus instead of /eggman/walrus.

Is there an elegant way to set a basepath to all redirects?

1 个答案:

答案 0 :(得分:1)

The hack is to use res.redirect('/<webtaskName>/path'.

I've sent a PR to address this at the library level but I don't expect them to implement it.