mikeck1 / foodtruck

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

foodtruck-api --- (▀̿Ĺ̯▀̿ ̿)

Node.js express mongoose+mongodb ES6 babel body parser

API backend for adding foodtrucks w/ details, and reviews.

Use Postman or web/mobile client to control API.

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
Refer to model and controllers for CRUD requests


How to install: (Assuming MongoDB is installed/running and Node.js is installed)

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





About


Languages

Language:JavaScript 100.0%