-
Notifications
You must be signed in to change notification settings - Fork 1
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
hvalfangst
committed
Dec 25, 2023
1 parent
9b8b4b0
commit 454b472
Showing
6 changed files
with
37 additions
and
24 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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from flask import Flask | ||
|
||
# Always use relative import for custom module | ||
from .package.module import MODULE_VALUE | ||
|
||
app = Flask(__name__) | ||
|
||
|
||
@app.route("/") | ||
def index(): | ||
return ( | ||
"Try /hello/Chris for parameterized Flask route.\n" | ||
"Try /module for module import guidance" | ||
) | ||
|
||
|
||
@app.route("/hello/<name>", methods=['GET']) | ||
def hello(name: str): | ||
return f"hello {name}" | ||
|
||
|
||
@app.route("/module") | ||
def module(): | ||
return f"loaded from FlaskApp.package.module = {MODULE_VALUE}" | ||
|
||
|
||
if __name__ == "__main__": | ||
app.run() |
Empty file.
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
MODULE_VALUE = "Successfully import module" |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import azure.functions as func | ||
from FlaskApp import app | ||
|
||
|
||
def main(req: func.HttpRequest, context: func.Context) -> func.HttpResponse: | ||
"""Each request is redirected to the WSGI handler. | ||
""" | ||
return func.WsgiMiddleware(app.wsgi_app).handle(req, context) |
File renamed without changes.
This file was deleted.
Oops, something went wrong.