Reputation: 266
I created a node js service for my peoject.
My requirement is by typing "SERVICEURL/help", swagger file should be loaded and the same should be hosted to Azure.
But not able to achieve the requirement.
Is the requirement is valid and achievable, if yes, help me in this.
Thanks in advance.
Upvotes: 0
Views: 111
Reputation: 9950
To achieve your requirement, you can try the following,
app.get('/help', function (request, response) {
response.writeHead(301,
{Location: 'http://yoursitename.azurewebsites.net/swagger'}
);
response.end();
})
If you are using Express framework, you can also do the same thing with the code below,
app.get('/help', function (req, res) {
res.redirect('http://yoursitename.azurewebsites.net/swagger');
})
Upvotes: 1