Skip to content

Commit b8174bf

Browse files
author
Mikelle Wade
committed
update project to use CDN version for axios
1 parent fae6099 commit b8174bf

7 files changed

+15
-174
lines changed

README.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,8 @@ You are required to use vanilla JavaScript for all parts of this project, includ
5656
## Axios
5757
The only extra JavaScript library we should load is [`Axios`](https://axios-http.com/docs/intro).
5858

59-
To download the `axios` node module, run `npm install`
60-
6159
To include axios in your project, include the following script tag above the script tag linking `index.js`:
62-
- `<script src="./node_modules/axios/dist/axios.min.js"></script>`
60+
- `<script src="https://unpkg.com/axios/dist/axios.min.js"></script>`
6361

6462
This should be done during the Wave 1 initial setup of your `index.html` page.
6563

ada-project-docs/deploy.md

+11-52
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,18 @@
1-
# Deploying to GitHub Pages with `parcel`
1+
# Deploying to GitHub Pages
22

3-
Follow the steps below to deploy to GitHub Pages using `parcel`
4-
5-
1. Create a new branch called `deployed-version` and switch to it.
6-
2. Install `parcel`
7-
```bash
8-
npm install parcel -D
9-
```
10-
3. Install `gh-pages`
3+
Follow the steps below to deploy to GitHub Pages
4+
1. Create a new branch called `deployed-version` and switch to it with the following command:
115
```bash
12-
npm install gh-pages -D
13-
4. Remove `script` tag with `"./node_modules/axios/dist/axios.min.js"` from `index.html`
14-
5. Add `import` statements to `index.js`
15-
```js
16-
import 'regenerator-runtime/runtime';
17-
import axios from 'axios';
18-
```
19-
6. Add a `"scripts"` section to your `package.json`:
20-
```json
21-
"scripts": {
22-
"predeploy": "rm -rf dist && npm run build",
23-
"deploy": "gh-pages -d dist",
24-
"test": "echo \"Error: no test specified\" && exit 1",
25-
"dev": "parcel index.html ",
26-
"build": "parcel build index.html --public-url /weather-report/"
27-
}
28-
```
29-
<details>
30-
<summary>Complete <code>package.json</code></summary>
6+
$ git checkout -b deployed-version
7+
```
318

32-
```json
33-
{
34-
"scripts": {
35-
"predeploy": "rm -rf dist && npm run build",
36-
"deploy": "gh-pages -d dist",
37-
"test": "echo \"Error: no test specified\" && exit 1",
38-
"dev": "parcel index.html ",
39-
"build": "parcel build index.html --public-url /weather-report/"
40-
},
41-
"dependencies": {
42-
"axios": "^1.7.7"
43-
},
44-
"devDependencies": {
45-
"gh-pages": "^6.2.0",
46-
"parcel": "^2.12.0"
47-
}
48-
}
9+
2. Push your changes to your remote repository on a new branch called `deployed-version`
10+
```bash
11+
$ git push origin deployed-version
4912
```
50-
51-
</details>
52-
7. Run `npm run deploy`
53-
8. Confirm that the GitHub Pages branch is set to `gh-pages` in the GitHub UI by going to **Settings** --> **Pages** --> **Source**
54-
9. Navigate to `https://{your-user-name}.github.io/weather-report/` to see your deployed site.
13+
3. Confirm that the GitHub Pages branch is set to `deployed-version` in the GitHub UI by going to **Settings** --> **Pages** --> **Source**
14+
4. Navigate to `https://{your-user-name}.github.io/weather-report/` to see your deployed site.
5515

5616
## Resources
5717
- [How to Use Axios with Javascript](https://www.digitalocean.com/community/tutorials/js-axios-vanilla-js)
58-
- [How to publish a single page application at no cost with GitHub Pages (React, Svelte, etc)](https://levelup.gitconnected.com/how-to-publish-a-single-page-application-at-no-cost-with-github-pages-react-svelte-etc-897b8f75a22b)
59-
- [Parcel with gh-pages GitHub issue](https://github.com/parcel-bundler/parcel/issues/505)
18+
- [How to publish a single page application at no cost with GitHub Pages](https://docs.github.com/en/pages/quickstart)

ada-project-docs/optional-enhancements.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ It is more important and more valuable to do good work with the requirements, an
1818
- Deploy/host your project onto the Internet
1919
- If you deploy your *Weather Report web app*, you will also need to deploy the *Weather Report proxy server*.
2020
- We recommend deploying to GitHub Pages.
21-
- We encourage you to do some of your own research and then review [our resource on deploying to GitHub Pages using `parcel`](./deploy.md) as needed.
21+
- We encourage you to do some of your own research and then review [our resource on deploying to GitHub Pages](./deploy.md) as needed.

ada-project-docs/wave-01.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ We recommend you get started by writing the HTML in `index.html`.
1717
You will need to link:
1818
- `index.css`
1919
- `index.js`
20-
- `./node_modules/axios/dist/axios.min.js`
20+
- `https://unpkg.com/axios/dist/axios.min.js`
2121

2222
## Tips
2323

index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
<link rel="stylesheet" href="styles/index.css" />
1111
</head>
1212
<body>
13-
<script type="module" src="./src/index.js"></script>
13+
<script src="./src/index.js"></script>
1414
</body>
1515
</html>

package-lock.json

-111
This file was deleted.

package.json

-5
This file was deleted.

0 commit comments

Comments
 (0)