demo [will not work in browser (aside from view all/byID trucks), use postman! V
In Postman, for your header.. key:Authorization value: Bearer INSERT_TOKEN_HERE
Also, for body, click raw and toggle to JSON application/json (Same process for editing/adding a foodtruck)
https://3dgreens.com/api/v1/account/register
https://3dgreens.com/api/v1/account/login
https://3dgreens.com/api/v1/foodtruck/add
To View Food Trucks use postman or a browser
View All -> https://3dgreens.com/api/v1/foodtruck
View One -> https://3dgreens.com/api/v1/foodtruck/UNIQUE_ID
https://3dgreens.com/api/v1/foodtruck/UNIQUE_FOOD_TYPE
First, Pull up terminal
Get the git file and install dependencies
git clone https://github.com/mikeck1/foodtruck-api.git
cd foodtruck_api
npm install
To run:
npm run dev // Runs in dev mode
If running on server in production environment
npm run build // Builds a dist
npm install -g pm2 // popular production daemon (pre-config'd in package.json)
npm start // Injects & Runs instance dist and pm2 for daemon
sudo pm2 startup systemd // Runs pm2/dist at startup
sudo apt-get install nginx // go between server and api
sudo nano /etc/nginx/sites-available/default
Refer to google to configure nginx routing on your machine