-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
86 additions
and
69 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import fastapi | ||
|
||
app=fastapi.FastAPI() | ||
app = fastapi.FastAPI() | ||
|
||
# <TO DO> Add setup or configuration specifications for the application here | ||
# TODO: Add setup or configuration specifications for the application here |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,24 @@ | ||
import logging | ||
import azure.functions as func | ||
from FastAPIApp import app # Main API application | ||
import nest_asyncio | ||
from FastAPIApp import app # Main API application | ||
|
||
nest_asyncio.apply() | ||
|
||
|
||
@app.get("/sample") | ||
async def index(): | ||
return { | ||
"info": "Try /hello/Shivani for parameterized route.",} | ||
return { | ||
"info": "Try /hello/Shivani for parameterized route.", | ||
} | ||
|
||
|
||
@app.get("/hello/{name}") | ||
async def get_name( | ||
name: str,): | ||
return { | ||
"name": name,} | ||
async def get_name(name: str): | ||
return { | ||
"name": name, | ||
} | ||
|
||
|
||
async def main(req: func.HttpRequest, context: func.Context) -> func.HttpResponse: | ||
return func.AsgiMiddleware(app).handle(req, context) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,5 @@ | |
# Manually managing azure-functions-worker may cause unexpected issues | ||
|
||
azure-functions | ||
fastapi | ||
nest_asyncio |