- Hans Schroeder
- HP Laptop with Windows 10
- GitBash and GitHub
- VS Code
- node.js
- npm
- webpack
- esLint
- Exchange Rate API, a public API that gathers currency data from dozens of countries around the globe
- Mozilla Developer Network documentation
- Learn How To Program The curriculum for Epicodus students.
- w3Schools documentation on CSS stylings as well as jQuery A free web resource for coding and programming.
- YouTube
_This is an independent project for the coding bootcamp Epicodus. It's function is to allow users to compare the currency exchange rate between various countries. The purpose, however, is to demonstrate the author's understanding of making API calls, using Promises and Static Methods, as well as handling both successful and unsuccessful API calls.
Note, this will require your local device to have node.js installed
- Clone this repository to your desktop
- Open the folder saved to your desktop with VSCode (or any other IDE capable of running npm and webpack)
- Open a new terminal type npm install and hit enter
- Wait for all packages and documents to be installed and bundled
- While the package is installing, go to the Exhange Rate API website. Enter your e-mail address, and click "Get Free Key". You should receive an e-mail shortly after providing a link to confirm your e-mail. Once this is confirmed, you will receive your API key.
- Go back to you IDE and run npm install dotenv-webpack@2.0.0 --save-dev in the terminal.
- Go to the file webpack.config.js and add "const Dotenv = require('dotenv-webpack')" to the top of the page.
- Find the "plugins" array under "module.exports" and add "new Dotenv()" to the array
- Create a file in your main directory called .env and add this file to your .gitignore file
- Inside the .env file enter API_KEY=[your unique API here]. This will now communicate your API with the template literal holding the URL for this project.
- In the terminal, type npm run start
- This will open the project in your browser
- Simply enter the country code of the country you want to convert the currency value from, and enter the country code(s) for the country (or countries) to which you wish to compare exchange rates.
At this moment, the API is being called successfully, and is returning the correct conversion result to the user, provided there are no errors. Error messages are being returned to the user when applicable, however the error code (401, 404, etc.) is not.
Hans J Schroeder 2022