https://github.com/marutpun/currency-exchange
A currency exchange table cheat sheet
https://github.com/marutpun/currency-exchange
javascript netlify-functions reactjs
Last synced: 8 months ago
JSON representation
A currency exchange table cheat sheet
- Host: GitHub
- URL: https://github.com/marutpun/currency-exchange
- Owner: marutpun
- Created: 2021-01-22T04:33:03.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-04-17T03:41:34.000Z (over 2 years ago)
- Last Synced: 2025-01-11T07:15:06.180Z (10 months ago)
- Topics: javascript, netlify-functions, reactjs
- Language: JavaScript
- Homepage: https://stoic-fermat-ce79f5.netlify.app
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Currency Exchange
A currency exchange table for shopaholic.
View: https://stoic-fermat-ce79f5.netlify.app
API provided by ExchangeRatesAPI (500 req/month).
## Change logs
- Upgrade Parcel bundler to v2. (Spent 1-2 hours to finish it.)
- Added TailwindCSS, removed Semantic UI
- Fully migrated state from component to container
- Migrated to React 18
- Design made with Atkinson Hyperlegible font
- Removed update currency time. USELESS!
## Tools
- Parcel Bundler
- ReactJS, ReactDOM
- TailwindCSS
- Axios
- Netlify, Netlify function
- ExchangeRatesAPI
## Netlify function
### Create
To create a Netlify function. You will need
1. Create **netlify.toml** and provide build settings.
2. Create a function with the same name in directory function. (e.g. **functions/YOUR_FUNCTION.js**)
2.1 Create and export an async function name **handler**, use **event**, **context** as parameters. `async function handler(event, context) {}`, add your algorithm inside. You may use **axios** for Promise.
2.2 Return an object with statusCode and body in JSON.stringify.
### Usage
Fetch data with URL `'.netlify/functions/YOUR_FUNCTION'`
### Dev
Run a command `netlify dev`. It will run local development automatically. Add your Netlify function URL after the local development to see a full API response (e.g. **http://localhost:8888/.netlify/functions/YOUR_FILE_NAME**)
`