Skip to content

Commit

Permalink
Add local debugging config for VS/VSCode
Browse files Browse the repository at this point in the history
  • Loading branch information
justinyoo committed Oct 2, 2023
1 parent 2fa1e87 commit 1a6e992
Show file tree
Hide file tree
Showing 9 changed files with 566 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"ms-azuretools.vscode-azurefunctions",
"ms-dotnettools.csdevkit"
]
}
14 changes: 14 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Azure Functions Launch",
"type": "coreclr",
"request": "attach",
"processId": "${command:azureFunctions.pickProcess}"
}
]
}
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"azureFunctions.projectSubpath": "src/YouTubeSummariser.ApiApp"
"azureFunctions.projectSubpath": "src/YouTubeSummariser.ApiApp"
}
74 changes: 74 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "clean",
"command": "dotnet",
"args": [
"clean",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"type": "process",
"problemMatcher": "$msCompile",
"options": {}
},
{
"label": "build",
"command": "dotnet",
"args": [
"build",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"type": "process",
"dependsOn": "clean",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": "$msCompile",
"options": {}
},
{
"label": "clean release",
"command": "dotnet",
"args": [
"clean",
"--configuration",
"Release",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"type": "process",
"problemMatcher": "$msCompile",
"options": {}
},
{
"label": "publish",
"command": "dotnet",
"args": [
"publish",
"--configuration",
"Release",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"type": "process",
"dependsOn": "clean release",
"problemMatcher": "$msCompile",
"options": {}
},
{
"label": "start",
"type": "shell",
"dependsOn": "build",
"options": {
"cwd": "${workspaceFolder}/src/YouTubeSummariser.ApiApp/bin/Debug/net7.0",
},
"command": "func host start",
"isBackground": true,
"problemMatcher": "$func-dotnet-watch"
}
]
}
101 changes: 101 additions & 0 deletions infra/swagger-apim-aoai.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{
"swagger": "2.0",
"info": {
"title": "YouTube Summariser",
"version": "1.0",
"description": "This is a set of APIs that summarises YouTube video content.",
"license": {
"name": "MIT",
"url": "http://opensource.org/licenses/MIT"
}
},
"host": "apim-{{AZURE_ENV_NAME}}.azure-api.net",
"basePath": "/aoai",
"schemes": [
"https"
],
"securityDefinitions": {
"apiKeyHeader": {
"type": "apiKey",
"name": "Ocp-Apim-Subscription-Key",
"in": "header"
},
"apiKeyQuery": {
"type": "apiKey",
"name": "subscription-key",
"in": "query"
}
},
"security": [
{
"apiKeyHeader": []
},
{
"apiKeyQuery": []
}
],
"paths": {
"/summarise": {
"post": {
"description": "This gets the summary from a YouTube video.",
"operationId": "summarise",
"summary": "Gets the summary from YouTube video",
"tags": [
"summary"
],
"parameters": [
{
"name": "summariseRequestModel",
"in": "body",
"schema": {
"$ref": "#/definitions/summariseRequestModel"
},
"description": "The YouTube video information."
}
],
"consumes": [
"application/json"
],
"produces": [
"text/plain"
],
"responses": {
"200": {
"description": "Payload of String",
"schema": {
"type": "string"
}
},
"400": {
"description": "This indicates the request is invalid."
},
"500": {
"description": "This indicates the server is not working as expected."
}
}
}
}
},
"definitions": {
"summariseRequestModel": {
"type": "object",
"properties": {
"videoUrl": {
"type": "string"
},
"videoLanguageCode": {
"type": "string"
},
"summaryLanguageCode": {
"type": "string"
}
},
"example": {
"videoUrl": "string",
"videoLanguageCode": "string",
"summaryLanguageCode": "string"
}
}
},
"tags": []
}
94 changes: 94 additions & 0 deletions infra/swagger-webapi-aoai.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{
"swagger": "2.0",
"info": {
"title": "Local Debugging",
"version": "1.0"
},
"paths": {
"/api/summarise": {
"post": {
"tags": [
"Summarise"
],
"operationId": "summarise",
"consumes": [
"application/json"
],
"produces": [
"text/plain",
"application/json",
"text/json"
],
"parameters": [
{
"in": "body",
"name": "body",
"schema": {
"$ref": "#/definitions/SummariseRequestModel"
}
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "string"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/ProblemDetails"
}
},
"500": {
"description": "Server Error"
}
}
}
}
},
"definitions": {
"ProblemDetails": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"title": {
"type": "string"
},
"status": {
"format": "int32",
"type": "integer"
},
"detail": {
"type": "string"
},
"instance": {
"type": "string"
}
},
"additionalProperties": {}
},
"SummariseRequestModel": {
"type": "object",
"properties": {
"videoUrl": {
"type": "string"
},
"videoLanguageCode": {
"type": "string"
},
"summaryLanguageCode": {
"type": "string"
}
},
"additionalProperties": false
}
},
"host": "localhost:5001",
"schemes": [
"https"
]
}
Loading

0 comments on commit 1a6e992

Please sign in to comment.