diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index 7f30650..0000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -# Find the Dockerfile for mcr.microsoft.com/azure-functions/node at the following URLs: -# Node 10: https://github.com/Azure/azure-functions-docker/blob/master/host/3.0/buster/amd64/node/node10/node10-core-tools.Dockerfile -# Node 12: https://github.com/Azure/azure-functions-docker/blob/master/host/3.0/buster/amd64/node/node12/node12-core-tools.Dockerfile -ARG VARIANT=12 -FROM mcr.microsoft.com/azure-functions/node:3.0-node${VARIANT}-core-tools - -# [Optional] Uncomment this section to install additional OS packages. -# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ -# && apt-get -y install --no-install-recommends - diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index 89b1472..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "Azure Functions & Node.js", - "build": { - "dockerfile": "Dockerfile", - // Update 'VARIANT' to pick a Node.js version: 10, 12 - "args": { - "VARIANT": "12" - } - }, - "forwardPorts": [ - 7071, - 3000 - ], - // Set *default* container specific settings.json values on container create. - "settings": { - "terminal.integrated.shell.linux": "/bin/bash" - }, - // Add the IDs of extensions you want installed when the container is created. - "extensions": [ - "ms-azuretools.vscode-azurefunctions", - "ms-azuretools.vscode-azurestaticwebapps", - "dbaeumer.vscode-eslint" - ], - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "npm install", - // Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root. - "remoteUser": "node" -} \ No newline at end of file diff --git a/.vscode/extensions.json b/.vscode/extensions.json deleted file mode 100644 index 26786f9..0000000 --- a/.vscode/extensions.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "recommendations": [ - "ms-azuretools.vscode-azurefunctions" - ] -} diff --git a/.vscode/launch.json b/.vscode/launch.json index e7be044..573bd0d 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -2,11 +2,25 @@ "version": "0.2.0", "configurations": [ { - "name": "Attach to Node Functions", "type": "node", - "request": "attach", + "request": "launch", + "name": "Launch Server", + "runtimeExecutable": "npm", + "runtimeArgs": [ + "run-script", + "server" + ], "port": 9229, - "preLaunchTask": "func: host start" + "skipFiles": [ + "/**" + ] + }, + { + "name": "Launch Chrome (Desktop Only)", + "request": "launch", + "type": "pwa-chrome", + "url": "http://localhost:3000", + "webRoot": "${workspaceFolder}" } ] } \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index bc8c902..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "azureFunctions.deploySubpath": "api", - "azureFunctions.postDeployTask": "npm install", - "azureFunctions.projectLanguage": "JavaScript", - "azureFunctions.projectRuntime": "~3", - "debug.internalConsoleOptions": "neverOpen", - "azureFunctions.preDeployTask": "npm prune" -} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json deleted file mode 100644 index e78ad55..0000000 --- a/.vscode/tasks.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "version": "2.0.0", - "tasks": [ - { - "type": "func", - "command": "host start", - "problemMatcher": "$func-watch", - "isBackground": true, - "dependsOn": "npm install", - "options": { - "cwd": "${workspaceFolder}/api" - } - }, - { - "type": "shell", - "label": "npm install", - "command": "npm install", - "options": { - "cwd": "${workspaceFolder}/api" - } - }, - { - "type": "shell", - "label": "npm prune", - "command": "npm prune --production", - "problemMatcher": [], - "options": { - "cwd": "${workspaceFolder}/api" - } - } - ] -} \ No newline at end of file diff --git a/README.md b/README.md index 54ef094..eeb140b 100644 --- a/README.md +++ b/README.md @@ -23,9 +23,9 @@ Builds the app for production to the `build` folder.
It correctly bundles React in production mode and optimizes the build for the best performance. The build is minified and the filenames include the hashes.
-Your app is ready to be deployed! +Your app is ready to be deployed. -See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. +See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information ### `npm run eject` @@ -45,7 +45,7 @@ To learn React, check out the [React documentation](https://reactjs.org/). ### Code Splitting -This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting +This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting. ### Analyzing the Bundle Size diff --git a/api/.funcignore b/api/.funcignore deleted file mode 100644 index 5179222..0000000 --- a/api/.funcignore +++ /dev/null @@ -1,7 +0,0 @@ -*.js.map -*.ts -.git* -.vscode -local.settings.json -test -tsconfig.json \ No newline at end of file diff --git a/api/.gitignore b/api/.gitignore deleted file mode 100644 index 772851c..0000000 --- a/api/.gitignore +++ /dev/null @@ -1,94 +0,0 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# TypeScript v1 declaration files -typings/ - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env -.env.test - -# parcel-bundler cache (https://parceljs.org/) -.cache - -# next.js build output -.next - -# nuxt.js build output -.nuxt - -# vuepress build output -.vuepress/dist - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TypeScript output -dist -out - -# Azure Functions artifacts -bin -obj -appsettings.json -local.settings.json \ No newline at end of file diff --git a/api/GetProducts/function.json b/api/GetProducts/function.json deleted file mode 100644 index 72a6566..0000000 --- a/api/GetProducts/function.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "bindings": [ - { - "authLevel": "anonymous", - "type": "httpTrigger", - "direction": "in", - "name": "req", - "methods": [ - "get" - ], - "route": "products" - }, - { - "type": "http", - "direction": "out", - "name": "res" - } - ] -} \ No newline at end of file diff --git a/api/GetProducts/index.js b/api/GetProducts/index.js deleted file mode 100644 index f290034..0000000 --- a/api/GetProducts/index.js +++ /dev/null @@ -1,8 +0,0 @@ -const products = require("../data/products.json"); - -module.exports = async function (context, req) { - context.res = { - // status: 200, /* Defaults to 200 */ - body: products - }; -} \ No newline at end of file diff --git a/api/GetProducts/sample.dat b/api/GetProducts/sample.dat deleted file mode 100644 index 2e60943..0000000 --- a/api/GetProducts/sample.dat +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "Azure" -} \ No newline at end of file diff --git a/api/host.json b/api/host.json deleted file mode 100644 index 6ab6643..0000000 --- a/api/host.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "version": "2.0", - "logging": { - "applicationInsights": { - "samplingSettings": { - "isEnabled": true, - "excludedTypes": "Request" - } - } - }, - "extensionBundle": { - "id": "Microsoft.Azure.Functions.ExtensionBundle", - "version": "[1.*, 2.0.0)" - } -} diff --git a/api/package-lock.json b/api/package-lock.json deleted file mode 100644 index 0bb6c76..0000000 --- a/api/package-lock.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "api", - "version": "1.0.0", - "lockfileVersion": 1 -} diff --git a/api/package.json b/api/package.json deleted file mode 100644 index 10f08ee..0000000 --- a/api/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "api", - "version": "1.0.0", - "description": "", - "scripts": { - "start": "func start", - "test": "echo \"No tests yet...\"" - }, - "dependencies": {}, - "devDependencies": {} -} diff --git a/api/proxies.json b/api/proxies.json deleted file mode 100644 index b385252..0000000 --- a/api/proxies.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/proxies", - "proxies": {} -} diff --git a/package-lock.json b/package-lock.json index d3e9200..43bb051 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2554,14 +2554,6 @@ "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.1.tgz", "integrity": "sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA==" }, - "axios": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.20.0.tgz", - "integrity": "sha512-ANA4rr2BDcmmAQLOKft2fufrtuvlqR+cXNNinUmvfeSNCOF98PZL+7M/v1zIdGo7OLjEA9J2gXJL+j4zGsl0bA==", - "requires": { - "follow-redirects": "^1.10.0" - } - }, "axobject-query": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.2.0.tgz", diff --git a/package.json b/package.json index 13472ce..abb129e 100644 --- a/package.json +++ b/package.json @@ -6,15 +6,16 @@ "@testing-library/jest-dom": "^4.2.4", "@testing-library/react": "^9.5.0", "@testing-library/user-event": "^7.2.1", - "axios": "^0.20.0", "bulma": "^0.9.1", "node-sass": "^4.14.1", "react": "^16.14.0", "react-dom": "^16.14.0", - "react-scripts": "3.4.3" + "react-scripts": "3.4.3", + "express": "4.17.1" }, "scripts": { "start": "react-scripts start", + "server": "node ./server/server.js", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" @@ -34,5 +35,5 @@ "last 1 safari version" ] }, - "proxy": "http://localhost:7071" + "proxy": "http://localhost:3005" } diff --git a/scenarioStatus.md b/scenarioStatus.md new file mode 100644 index 0000000..f7dff2d --- /dev/null +++ b/scenarioStatus.md @@ -0,0 +1,22 @@ +## Scenario Status + +### Legend + +| Status | Definition | +| ---- | ---- | +|🔴| Blocking | +|🟢| Passing | +|🟡| Issue, but not blocking | + +### Status + +| Date | Extension | Get the Repo | Install Extensions | Install Az Func Tools | Run Client | Run Server | Port Forwarding | Debugging | +| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | +| 10/20/20 | n/a |:yellow_circle:|:green_circle:|:yellow_circle:|:green_circle:|:red_circle: https://github.com/github/codespaces/issues/1435
workaround: run `func host start` from the `api` folder |:green_circle:|:red_circle: https://github.com/github/codespaces/issues/1435 | +| 11/24/20 | n/a |:green_circle:|:green_circle:|:green_circle:|:green_circle:|:red_circle: https://github.com/Azure/Azure-Functions/issues/1454 | | | +| 12/1/20 | n/a |:green_circle:|:green_circle:|:green_circle:|:green_circle:|:red_circle: https://github.com/Azure/Azure-Functions/issues/1454 / https://github.com/microsoft/vssaas-planning/issues/1518#issuecomment-736834342 | | | +| 12/2/20 | n/a |:green_circle:|:green_circle:|:yellow_circle:|:green_circle:|:red_circle: https://github.com/Azure/Azure-Functions/issues/1454 / https://github.com/microsoft/vssaas-planning/issues/1518#issuecomment-736834342 | | | +| 12/2/20 | n/a |:green_circle:|:green_circle:|:green_circle:|:green_circle:|:green_circle:|:green_circle:|:green_circle:| +:red +| 12/10/20 | n/a |:green_circle:|:green_circle:|:green_circle:|:green_circle:|:green_circle:|:green_circle:|:red_circle: https://github.com/microsoft/vscode-internalbacklog/issues/1680 +| 12/17/20 | n/a |:green_circle:|:green_circle:|:green_circle:|:green_circle:|:green_circle:|:green_circle:|:red_circle: https://github.com/microsoft/vscode-internalbacklog/issues/1680 \ No newline at end of file diff --git a/api/data/products.json b/server/products.json similarity index 100% rename from api/data/products.json rename to server/products.json diff --git a/server/server.js b/server/server.js new file mode 100644 index 0000000..7cd6a08 --- /dev/null +++ b/server/server.js @@ -0,0 +1,18 @@ +const express = require('express'); +const products = require("./products.json"); + +const app = express(); + +app.use('/GetProducts', function(req, res, next) { + res.send(products); + // test +}) + +app.listen(3005, function() { + + // listening on a port + // console.log("server is listening"); + + console.log('server listening on http://localhost:3005'); +}); + diff --git a/src/App.js b/src/App.js index 8986ab0..f374f15 100644 --- a/src/App.js +++ b/src/App.js @@ -1,5 +1,4 @@ import React, { useEffect, useState } from 'react'; -import axios from 'axios'; const App = () => { const [products, setProducts] = useState([]); @@ -7,12 +6,15 @@ const App = () => { useEffect(() => { async function getProducts() { - const response = await axios.get('api/products'); - setProducts(response.data); + const response = await fetch('/GetProducts').then(res => res.json()); + setProducts(response); setLoading(false); } + // comments + getProducts(); + }, []) return (