Skip to content

Latest commit

 

History

History
70 lines (46 loc) · 1.95 KB

README.md

File metadata and controls

70 lines (46 loc) · 1.95 KB

BookBridge

BookBridge is an API for managing book clubs, supporting endpoints for CRUD operations and managing clubs, users, books, reviews, readlist and etc..

Depencies

book bridge depends on node.js, mysql and bash.

Description Description Description

build and run

give execution permission to build.sh and all files inside scripts folder

chmod +x build.sh

Then setup the database and build the API with

./build.sh --database --restart
./build.sh --run

Tests

to run the test simply type

./build.sh --tests

or manually restart database, rebuild the API and run:

npx jest

endpoints

In request.sh file you may find examples of curl request such as

TOKEN="$(curl --header "Content-Type: application/json" 
              --request POST 
              --data '{"username":"user","password":"user"}' 
              http://localhost:4000/api/user/login 
              | jq -r '.token')"
          
curl --header "Content-Type: application/json" \
     --request POST \
     --data '{"title":"o vermelho e o negro","isbn":"00033", "token":"'$TOKEN'" }' \
     http://localhost:4000/api/book

you can execute it and other endpoints with build:

./build.sh --request --user-create
./build.sh --request --user-login