Created
April 19, 2022 07:54
-
-
Save ntakouris/e8ac83275e98d8c8c0a7eb3133ce8f54 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApiRoot: | |
Base = "/api" | |
Frontend = "/ui" | |
class Users: | |
inner_base = ApiRoot.Base + "/users" | |
Register = inner_base + "/register" | |
ByName = lambda name: ApiRoot.Users.inner_base + f"/{name}" | |
fastapi_app = FastAPI() | |
@fastapi_app.post(Users.Register) | |
async def users_register(): | |
return None | |
@fastapi_app.get(Users.ByName("{name}")) | |
async def users_get_by_name(name: str): | |
return name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment