git clone https://github.com/shruti1421/assignment-1
cd /assignment-1
npm install
npm start
- API will start running on localhost:3000
GET /view
Request | Access | Description |
---|---|---|
GET |
Public | Get all csv data |
GET /find/isbn/:ISBN
Request | Access | Description |
---|---|---|
GET |
Public | Find a book or magazine by its ISBN |
GET /find/email/:email
Request | Access | Description |
---|---|---|
GET |
Public | Find all books and magazines by their authors’ email |
POST /view/sortbytitle
Request | Access | Description |
---|---|---|
GET |
Public | Print out all books and magazines with all their details sorted by title |
PUT /addBook
Request | Access | Description |
---|---|---|
POST |
Public | Add a book to csv file |
PUT /addMagazine
Request | Access | Description |
---|---|---|
POST |
Public | Add a magazine to csv file |
Give an input file like:
title | isbn | authors | description |
---|---|---|---|
Constantin | 1234-5678-92 | clangsdon0@hc360.com | Description about the book. |
e.g. :
{
"title": "Constantin",
"isbn": "1234-5678-92",
"authors": "clangsdon0@hc360.com",
"description": "Description about the book",
}
will generate:
title;isbn;authors;description;
Constantin;1234-5678-92;clangsdon0@hc360.com;Description about the book.