Skip to content

How to change the base path? #2964

Closed Answered by provinzkraut
danielniccoli asked this question in Q&A
Discussion options

You must be logged in to vote

Just add your route handlers to a Router instead of to Litestar directly. Then you can change the base path there for everything except the /schema:

api_router = Router(path="/api", route_handlers=...)
app = Litestar(route_handlers=[api_router])

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@danielniccoli
Comment options

Answer selected by danielniccoli
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants