Website cek ongkos kirim memakai NodeJS dan Express serta API RajaOngkir
- NodeJS - V16.x.x
- NPM - V8.x.x
- Download / clone this repository to your local machine
git clone https://github.com/zalfaone/rest-rajaongkir.git
- Change directory to
rest-rajaongkir
cd rest-rajaongkir
- Init this project as npm module
npm init -y
- Install all modules on this project, you can see
package.json
for details
npm install
- Check this api documentation to get Api Key (IMPORTANT), type this url to your browser
https://rajaongkir.com/dokumentasi/starter
(You should choose/set account as starter type)
- If you have got an api, edit this file
routes/api.js
on line6
. Change"ENTER_YOUR_API_KEY_HERE"
to your Api Key
5. ....
6. axios.defaults.headers.common["key"] = "ENTER_YOUR_API_KEY_HERE"; // edit this line
7. ....
- Run your website
node app
or
nodemon app (if you install nodemon)
- Open your browser go to this url
http://127.0.0.1:4000/