From c94c8ad669a96dfbb4dd99ff2b63cae110b480a0 Mon Sep 17 00:00:00 2001 From: Dylan Wieber Date: Thu, 2 Jun 2022 12:39:45 -0400 Subject: [PATCH 1/3] Commit made from VS Code Azure Static Web Apps --- angular-app/package-lock.json | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/angular-app/package-lock.json b/angular-app/package-lock.json index f6bc161..5ad8842 100644 --- a/angular-app/package-lock.json +++ b/angular-app/package-lock.json @@ -2826,6 +2826,8 @@ "version": "8.6.0", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "fast-deep-equal": "^3.1.1", "json-schema-traverse": "^1.0.0", @@ -2840,7 +2842,9 @@ "node_modules/ajv-formats/node_modules/json-schema-traverse": { "version": "1.0.0", "dev": true, - "license": "MIT" + "license": "MIT", + "optional": true, + "peer": true }, "node_modules/ajv-keywords": { "version": "3.5.2", @@ -3955,6 +3959,7 @@ "version": "9.0.0", "dev": true, "license": "MIT", + "peer": true, "peerDependencies": { "tslib": "^1.10.0" } @@ -3963,6 +3968,7 @@ "version": "9.0.0", "dev": true, "license": "MIT", + "peer": true, "peerDependencies": { "rxjs": "^6.5.3", "tslib": "^1.10.0", @@ -16761,13 +16767,13 @@ "ajv-formats": { "version": "2.0.2", "dev": true, - "requires": { - "ajv": "^8.0.0" - }, + "requires": {}, "dependencies": { "ajv": { "version": "8.6.0", "dev": true, + "optional": true, + "peer": true, "requires": { "fast-deep-equal": "^3.1.1", "json-schema-traverse": "^1.0.0", @@ -16777,7 +16783,9 @@ }, "json-schema-traverse": { "version": "1.0.0", - "dev": true + "dev": true, + "optional": true, + "peer": true } } }, @@ -17504,8 +17512,6 @@ "version": "6.0.1", "dev": true, "requires": { - "@angular/compiler": "9.0.0", - "@angular/core": "9.0.0", "app-root-path": "^3.0.0", "aria-query": "^3.0.0", "axobject-query": "2.0.2", @@ -17523,11 +17529,13 @@ "@angular/compiler": { "version": "9.0.0", "dev": true, + "peer": true, "requires": {} }, "@angular/core": { "version": "9.0.0", "dev": true, + "peer": true, "requires": {} }, "source-map": { From 609bbe3a12ccd4e9e1f3f241fd585eab1f175021 Mon Sep 17 00:00:00 2001 From: Dylan Wieber Date: Thu, 2 Jun 2022 13:10:49 -0400 Subject: [PATCH 2/3] Changed api-starter to api --- {api-starter => api}/.funcignore | 0 {api-starter => api}/.gitignore | 0 {api-starter => api}/README.md | 0 {api-starter => api}/host.json | 0 {api-starter => api}/package-lock.json | 0 {api-starter => api}/package.json | 0 {api-starter => api}/products-delete/function.json | 0 {api-starter => api}/products-delete/index.js | 0 {api-starter => api}/products-post/function.json | 0 {api-starter => api}/products-post/index.js | 0 {api-starter => api}/products-put/function.json | 0 {api-starter => api}/products-put/index.js | 0 {api-starter => api}/proxies.json | 0 {api-starter => api}/shared/product-data.js | 0 14 files changed, 0 insertions(+), 0 deletions(-) rename {api-starter => api}/.funcignore (100%) rename {api-starter => api}/.gitignore (100%) rename {api-starter => api}/README.md (100%) rename {api-starter => api}/host.json (100%) rename {api-starter => api}/package-lock.json (100%) rename {api-starter => api}/package.json (100%) rename {api-starter => api}/products-delete/function.json (100%) rename {api-starter => api}/products-delete/index.js (100%) rename {api-starter => api}/products-post/function.json (100%) rename {api-starter => api}/products-post/index.js (100%) rename {api-starter => api}/products-put/function.json (100%) rename {api-starter => api}/products-put/index.js (100%) rename {api-starter => api}/proxies.json (100%) rename {api-starter => api}/shared/product-data.js (100%) diff --git a/api-starter/.funcignore b/api/.funcignore similarity index 100% rename from api-starter/.funcignore rename to api/.funcignore diff --git a/api-starter/.gitignore b/api/.gitignore similarity index 100% rename from api-starter/.gitignore rename to api/.gitignore diff --git a/api-starter/README.md b/api/README.md similarity index 100% rename from api-starter/README.md rename to api/README.md diff --git a/api-starter/host.json b/api/host.json similarity index 100% rename from api-starter/host.json rename to api/host.json diff --git a/api-starter/package-lock.json b/api/package-lock.json similarity index 100% rename from api-starter/package-lock.json rename to api/package-lock.json diff --git a/api-starter/package.json b/api/package.json similarity index 100% rename from api-starter/package.json rename to api/package.json diff --git a/api-starter/products-delete/function.json b/api/products-delete/function.json similarity index 100% rename from api-starter/products-delete/function.json rename to api/products-delete/function.json diff --git a/api-starter/products-delete/index.js b/api/products-delete/index.js similarity index 100% rename from api-starter/products-delete/index.js rename to api/products-delete/index.js diff --git a/api-starter/products-post/function.json b/api/products-post/function.json similarity index 100% rename from api-starter/products-post/function.json rename to api/products-post/function.json diff --git a/api-starter/products-post/index.js b/api/products-post/index.js similarity index 100% rename from api-starter/products-post/index.js rename to api/products-post/index.js diff --git a/api-starter/products-put/function.json b/api/products-put/function.json similarity index 100% rename from api-starter/products-put/function.json rename to api/products-put/function.json diff --git a/api-starter/products-put/index.js b/api/products-put/index.js similarity index 100% rename from api-starter/products-put/index.js rename to api/products-put/index.js diff --git a/api-starter/proxies.json b/api/proxies.json similarity index 100% rename from api-starter/proxies.json rename to api/proxies.json diff --git a/api-starter/shared/product-data.js b/api/shared/product-data.js similarity index 100% rename from api-starter/shared/product-data.js rename to api/shared/product-data.js From 72a22a763419cb21ba74533f886ca129bdcb6222 Mon Sep 17 00:00:00 2001 From: Dylan Wieber Date: Thu, 2 Jun 2022 14:17:30 -0400 Subject: [PATCH 3/3] Updates for api --- ...re-static-web-apps-nice-tree-040bc7e0f.yml | 2 +- api/products-get/function.json | 19 +++++++++++++++++++ api/products-get/index.js | 10 ++++++++++ api/products-get/sample.dat | 3 +++ 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 api/products-get/function.json create mode 100644 api/products-get/index.js create mode 100644 api/products-get/sample.dat diff --git a/.github/workflows/azure-static-web-apps-nice-tree-040bc7e0f.yml b/.github/workflows/azure-static-web-apps-nice-tree-040bc7e0f.yml index 34f169e..86e87be 100644 --- a/.github/workflows/azure-static-web-apps-nice-tree-040bc7e0f.yml +++ b/.github/workflows/azure-static-web-apps-nice-tree-040bc7e0f.yml @@ -28,7 +28,7 @@ jobs: ###### Repository/Build Configurations - These values can be configured to match your app requirements. ###### # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig app_location: "angular-app" # App source code path - api_location: "api-starter" # Api source code path - optional + api_location: "api" # Api source code path - optional output_location: "dist/angular-app" # Built app content directory - optional ###### End of Repository/Build Configurations ###### diff --git a/api/products-get/function.json b/api/products-get/function.json new file mode 100644 index 0000000..2e942b7 --- /dev/null +++ b/api/products-get/function.json @@ -0,0 +1,19 @@ +{ + "bindings": [ + { + "authLevel": "anonymous", + "type": "httpTrigger", + "direction": "in", + "name": "req", + "methods": [ + "get" + ], + "route": "products" + }, + { + "type": "http", + "direction": "out", + "name": "res" + } + ] +} diff --git a/api/products-get/index.js b/api/products-get/index.js new file mode 100644 index 0000000..a3f6226 --- /dev/null +++ b/api/products-get/index.js @@ -0,0 +1,10 @@ +const data = require('../shared/product-data') + +module.exports = async function (context, req) { + try { + const products = data.getProducts(); + context.res.status(200).json(products); + } catch(error){ + context.res.status(500).send(error); + } +} \ No newline at end of file diff --git a/api/products-get/sample.dat b/api/products-get/sample.dat new file mode 100644 index 0000000..26aac46 --- /dev/null +++ b/api/products-get/sample.dat @@ -0,0 +1,3 @@ +{ + "name": "Azure" +} \ No newline at end of file