Book API coded in NodeJS. Uses MySQL Database.
- Returns Book Name, ID, Author, Description, ISBN, Book Price in JSON format.
- Routes,
Index :"/"
Insert Book : [POST]"/insert"
Return all Books :"/books"
Return all books in descending order :"/books/desc"
Return all Book Names :"/bookNames"
Return a Book by id :"/book/<id>"
Return a random Book :"/book/rand"
Return Books Price > :"/book/pgt/<value>"
Return Books Price < :"/book/plt/<value>"
-
Install Node Modules
for npmnpm install
for yarnyarn install
-
Create .env file. See example
-
Import books.sql to MySQL Database.
-
Run App
for npm,npm start
for yarn,yarn start
-
Run in Dev Mode,
for npmnpm run dev
for yarnyarn run dev
- Example POST data to insert a book
{ "book_name": "Gooseberries", "book_price": 250, "book_author": "Anton Chekhov", "isbn": "ISBN-13: 978-1-56619-909-4", "book_desc": "Gooseberries is one of Anton Chekhov's most famous short stories." }