Since the idea behind the module seems to be to use express APIs themselves, I believe you could just call res.redirect(<url>)
as required.
I've tested it with the following settings
- HttpTrigger/index.js
const createHandler = require("azure-function-express").createHandler;
const express = require("express");
// Create express app as usual
const app = express();
app.get("/api/", (req, res) => {
res.redirect('/api/abc/xyz');
});
app.get("/api/:foo/:bar", (req, res) => {
res.json({
foo: req.params.foo,
bar: req.params.bar
});
});
// Binds the express app to an Azure Function handler
module.exports = createHandler(app);
- HttpTrigger/function.json
{
"bindings": [
{
"authLevel": "function",
"type": "httpTrigger",
"direction": "in",
"name": "req",
"methods": [
"get",
"post"
],
"route": "api/{*segments}"
},
{
"type": "http",
"direction": "out",
"name": "res"
}
]
}
- host.json
{
"version": "2.0",
"extensions": {
"http": {
"routePrefix": ""
}
}
}