Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New branch #17

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
4594bdc
Add static web app extension to recommendations
chrisdias Oct 21, 2020
6dbe715
Update config
bamurtaugh Oct 21, 2020
7a412b3
Merge pull request #2 from chrisdias/master
burkeholland Oct 22, 2020
e02faea
delete devcontainer
burkeholland Oct 27, 2020
e187bcb
Update README with instructions
burkeholland Oct 27, 2020
0b78423
Add note about port forwarding
burkeholland Oct 27, 2020
48baff7
Add note about "IsEncryped"
burkeholland Oct 27, 2020
5f13676
Remove bold from table rows
burkeholland Oct 27, 2020
3993f39
Remove bold from table rows
burkeholland Oct 27, 2020
b5cd1d8
:Merge branch 'master' of https://github.com/burkeholland/gh-static-e…
burkeholland Oct 27, 2020
3415fc8
Merge pull request #1 from burkeholland/master
bamurtaugh Oct 27, 2020
97d04e0
Remove config
bamurtaugh Apr 29, 2021
94633b7
Update Python
Apr 30, 2021
2d6705d
Merge pull request #7 from bamurtaugh:Demo
bamurtaugh Apr 30, 2021
4db844a
Test
bamurtaugh May 25, 2021
6473142
Update README.md
bamurtaugh May 26, 2021
15e1096
Update
bamurtaugh May 26, 2021
8df1aeb
Update README.md
bamurtaugh May 26, 2021
46a96d2
Update README.md
bamurtaugh Jun 4, 2021
ddb30ed
Update readme
bamurtaugh Jun 4, 2021
5991b83
Update
bamurtaugh Jun 4, 2021
1b7d9af
Update readme
bamurtaugh Jun 4, 2021
71a8ed0
Update for PR
bamurtaugh Jun 4, 2021
1827a3f
Merge pull request #13 from bamurtaugh:NewReadmeBranch
bamurtaugh Jun 4, 2021
a1d90ea
Update
bamurtaugh Jun 4, 2021
845e62f
Update readme remotely
bamurtaugh Jun 4, 2021
ec2436f
Update readme for PR
bamurtaugh Jun 4, 2021
fda0283
Merge pull request #14 from bamurtaugh:ReadmeBranch
bamurtaugh Jun 4, 2021
4096fea
Update for a PR
bamurtaugh Jun 4, 2021
0f21a01
Another update
bamurtaugh Jun 4, 2021
c1c887d
Merge pull request #15 from bamurtaugh:UpdateReadmeBranch
bamurtaugh Jun 4, 2021
1a8e0ec
Update readme
bamurtaugh Jun 22, 2021
92d0a11
Update
bamurtaugh Jun 22, 2021
044bb8f
Update readme
bamurtaugh Jun 22, 2021
9c05c61
Update
bamurtaugh Jun 22, 2021
fa2d5c0
Update
bamurtaugh Jun 22, 2021
6e315f6
Revert
bamurtaugh Jun 22, 2021
17ad28f
Update
bamurtaugh Jun 22, 2021
10f7365
Update for PR
bamurtaugh Jun 22, 2021
204188a
Space
bamurtaugh Nov 5, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .devcontainer/Dockerfile

This file was deleted.

28 changes: 0 additions & 28 deletions .devcontainer/devcontainer.json

This file was deleted.

4 changes: 3 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"recommendations": [
"ms-azuretools.vscode-azurefunctions"
"ms-azuretools.vscode-azurefunctions",
"ms-azuretools.vscode-azurestaticwebapps"
]
}

3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"azureFunctions.projectLanguage": "JavaScript",
"azureFunctions.projectRuntime": "~3",
"debug.internalConsoleOptions": "neverOpen",
"azureFunctions.preDeployTask": "npm prune"
"azureFunctions.preDeployTask": "npm prune",
"python.pythonPath": "/usr/bin/python3"
}
79 changes: 26 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,68 +1,41 @@
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
# Static Web App

## Available Scripts
Update readme.

In the project directory, you can run:
Update readme for PR!

### `npm start`
## Setup

Runs the app in the development mode.<br />
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
1. Install the Azure Functions extension.

The page will reload if you make edits.<br />
You will also see any lint errors in the console.
1. Run the following to install Azure Functions Core Tools.

### `npm test`
```
npm i -g azure-functions-core-tools@3 --unsafe-perm true
```

Launches the test runner in the interactive watch mode.<br />
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
## Run the application

### `npm run build`
1. The frontend is a React app which is run with...

Builds the app for production to the `build` folder.<br />
It correctly bundles React in production mode and optimizes the build for the best performance.
```
npm start
```

The build is minified and the filenames include the hashes.<br />
Your app is ready to be deployed!
1. The backend is a Functions project that should be started from the run and debug panel.

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
> If you receive an error about "unable to decrypt settings" when trying to run the backend/Functions project, make sure the "IsEncryped" option is set to false in your "api/local.settings.json" file. It is a top level setting outside of "Values"...

### `npm run eject`
```
{
"IsEncrypted": false,
"Values": {
"FUNCTIONS_WORKER_RUNTIME": "node",
}
}
```

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
## Forward ports

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

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

### Analyzing the Bundle Size

This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size

### Making a Progressive Web App

This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app

### Advanced Configuration

This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration

### Deployment

This section has moved here: https://facebook.github.io/create-react-app/docs/deployment

### `npm run build` fails to minify

This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
1. Forward ports 3000 and 7071
55 changes: 21 additions & 34 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import React, { useEffect, useState } from 'react';
import axios from 'axios';
import React, { useEffect, useState } from "react";
import axios from "axios";

const App = () => {
const [products, setProducts] = useState([]);
const [loading, setLoading] = useState(true);

useEffect(() => {
async function getProducts() {
const response = await axios.get('api/products');
const response = await axios.get("api/products");
setProducts(response.data);
setLoading(false);
}

getProducts();
}, [])
}, []);

return (
<div id="app">
Expand All @@ -39,46 +39,33 @@ const App = () => {
</tr>
</thead>
<tbody>
{products.map(({ id, name, brand, price, stockUnits }, index) => (
<tr>
<td>
<label for="" className="label" type="text">
{name}
</label>
</td>
<td>
<label for="" className="label">
{brand.name}
</label>
</td>
<td>
<label for="" className="label">
{price}
</label>
</td>
<td>
<label for="" className="label has-text-centered">
{stockUnits}
</label>
</td>
</tr>
))}
{products.map(
({ id, name, brand, price, stockUnits }, index) => (
<tr>
<td>{name}</td>
<td>{brand.name}</td>
<td>{price}</td>
<td class="has-text-centered">{stockUnits}</td>
</tr>
)
)}
</tbody>
</table>
{loading ? (
<div className="has-text-centered" v-show="products.length < 1">
<h2 className="is-size-4 has-text-info">Loading...</h2>
</div>

) : ''}
) : (
""
)}
</div>
<div id="toast" v-show="toast.show" className="container">
<h2 className="is-size-5 has-text-white">Unable to reach API</h2>
</div>
</div >
</section >
</div >
</div>
</section>
</div>
);
}
};

export default App;
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ ReactDOM.render(
);

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// unregister() to register() below. Note this comes with some pitfalls
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();