BookAPI
Clone the repo:
git clone https://github.com/AmreetKumarkhuntia/bookAPI.git
Install the dependencies:
npm install
Set the environment variables:
cp .env.example .env
# open .env and modify the environment variables
Running in development:
npm start
The environment variables can be found and modified in the .env
file.
# Port
PORT = # default 5001
# URL of the Mongo DB
DATABASEURL = mongodb://127.0.0.1:27017/database_name
root\
|--.env # Environment variables
|--models\ # Mongoose models
|--routes\ # Routes
|--App.js # App entry point
List of available routes:
User routes:
POST api/books/
- Add a book
GET api/books/
- Get Books (optional parameters can be passed such as id, name, email, author, year, and the parameters should be passed in the body)
PUT api/books/:id
- Update Book