Skip to content
Discussion options

You must be logged in to vote

You need to create two separate decorators:

from fastapi import FastAPI

app = FastAPI()

@app.get("/get-employees")
@app.get("/employees")
def read_root():
    return {"Hello": "World"}

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by YuriiMotov
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
Labels
question Question or problem question-migrate
2 participants
Converted from issue

This discussion was converted from issue #3341 on February 27, 2023 22:48.