Skip to content

Commit

Permalink
test5
Browse files Browse the repository at this point in the history
  • Loading branch information
hvalfangst committed Dec 25, 2023
1 parent 9b8b4b0 commit 454b472
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 24 deletions.
28 changes: 28 additions & 0 deletions FlaskApp/__init__.py
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 added FlaskApp/package/__init__.py
Empty file.
1 change: 1 addition & 0 deletions FlaskApp/package/module.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MODULE_VALUE = "Successfully import module"
8 changes: 8 additions & 0 deletions HandleApproach/__init__.py
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.
24 changes: 0 additions & 24 deletions hvalfangstfunction/__init__.py

This file was deleted.

0 comments on commit 454b472

Please sign in to comment.