Skip to content
This repository has been archived by the owner on Apr 8, 2020. It is now read-only.

How to use Swagger and return 404 for unknown API urls #1119

Closed
ysazak opened this issue Jul 15, 2017 · 1 comment
Closed

How to use Swagger and return 404 for unknown API urls #1119

ysazak opened this issue Jul 15, 2017 · 1 comment

Comments

@ysazak
Copy link

ysazak commented Jul 15, 2017

How can I use swagger with this template? When I implement swagger, the swagger page is redirected to home page due to SpaFallbackRoute.

Also, when unknown api url (for example; api/xyz) is called, it redirects to home page. I would like to return 404

Thanks for your help

@SteveSandersonMS
Copy link
Member

Whatever middleware you're using for Swagger, put it before your call to SpaFallbackRoute, so it gets first priority on handling the request.

Also, when unknown api url (for example; api/xyz) is called, it redirects to home page. I would like to return 404

You can use a technique similar to this: #973 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants