sanic-org / sanic-ext

Extended Sanic functionality
https://sanic.dev/en/plugins/sanic-ext/getting-started.html
MIT License
50 stars 35 forks source link

#Question How can I open page with swagger? #196

Closed Maksim-Burtsev closed 1 year ago

Maksim-Burtsev commented 1 year ago

Hi. I have simple hello-world sanic application and when I start it i have page with ReDoc only which works.

изображение

And I have message about it in the console:

[2023-05-20 22:38:24 +0300] [92186] [INFO]   > injection [0 dependencies; 0 constants]
[2023-05-20 22:38:24 +0300] [92186] [INFO]   > openapi [http://0.0.0.0:8000/docs]
[2023-05-20 22:38:24 +0300] [92186] [INFO]   > http 

But if i open /swagger page i have 404:

изображение
from sanic import Sanic

app = Sanic("HelloWorld")

Why swagger doesnt works and how can i run it?

ahopkins commented 1 year ago

https://sanic.dev/en/plugins/sanic-ext/openapi/ui.html#ui image

That is of course just the default. You can configure it however you want.