sanic-org / sanic-ext

Extended Sanic functionality

Home Page:https://sanic.dev/en/plugins/sanic-ext/getting-started.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#Question How can I open page with swagger?

Maksim-Burtsev opened this issue · comments

commented

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?

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.