Skip to content

Commit

Permalink
update reademe and env
Browse files Browse the repository at this point in the history
  • Loading branch information
Ewan-MR committed Mar 19, 2024
1 parent 2d13db6 commit c8760bf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_API_KEY=650ad8fb3c6e4ecab3190253232706
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# React + Vite
# Weather App React + Vite ==> Azure

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
- [Visit site here ](https://jolly-bush-09eb13f00.5.azurestaticapps.net/)
- [Weatherapi ](https://www.weatherapi.com/)
- [Documentation Followed](https://vitejs.dev/guide/static-deploy.html#azure-static-web-apps)
4 changes: 3 additions & 1 deletion src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ function App() {
useEffect(() => {
//fetch the data from API endpoint
fetch(
`https://api.weatherapi.com/v1/current.json?key=650ad8fb3c6e4ecab3190253232706&q=${currentCity}&aqi=no`
`https://api.weatherapi.com/v1/current.json?key=${
import.meta.env.VITE_API_KEY
}&q=${currentCity}&aqi=no`
)
.then((res) => res.json())
.then((result) => {
Expand Down

0 comments on commit c8760bf

Please sign in to comment.