Skip to content

Commit

Permalink
Testing Azure Function
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul committed May 16, 2024
1 parent 56a711a commit 1b7a9d5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
1 change: 1 addition & 0 deletions function_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def tokenize_text(x):
return ' '.join(list(filter(lambda y: y.replace(' ', ''), word_tokenize(filter_thai(x)))))


@flask_app.function_name(name="GetProducts")
@flask_app.post("/predict")
def run_ai():
if request.headers['aikey'] == os.environ['AIKEY']:
Expand Down
17 changes: 8 additions & 9 deletions host.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
{
"version": "2.0",
"logging":
{
"applicationInsights":
{
"samplingSettings":
{
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
}
},
"logLevel": {
"default": "Trace"
}
},
"extensionBundle":
{
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[2.*, 3.0.0)"
"version": "[4.*, 5.0.0)"
},
"extensions":
{
Expand Down
Empty file added localsettings.json
Empty file.

0 comments on commit 1b7a9d5

Please sign in to comment.