Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gabrielbb/library-api
This is a simple Library REST API made with Node JS and an In-Memory SQLITE database.
https://github.com/gabrielbb/library-api
library-management-system nodejs sqlite
Last synced: 14 days ago
JSON representation
This is a simple Library REST API made with Node JS and an In-Memory SQLITE database.
- Host: GitHub
- URL: https://github.com/gabrielbb/library-api
- Owner: GabrielBB
- Created: 2019-04-09T03:36:34.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T17:27:21.000Z (almost 2 years ago)
- Last Synced: 2024-10-11T04:09:19.332Z (28 days ago)
- Topics: library-management-system, nodejs, sqlite
- Language: JavaScript
- Homepage:
- Size: 313 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Library API
### This is a simple Library REST API made with Node JS and an In-Memory SQLITE database.
To make the database migration pretty simple there is a seed.sql file under /src/helpers/. The application looks for this file and makes an execution to the database everytime it starts. This will make it simple to get you up and running without any configuration.
The reason why there is a "views" folder in this REST API is because i wanted to imitate the way Google Chrome renders PDF files. So, i used CSS inside an HTML file and used a view engine to parse that HTML with the book content. This way when you specify that you want the HTML version of a book page, it will look just like a real book page!
-----------------------------------
How to configure the app:
Make sure you have Node JS 8 or later in your machine and run this command in the project folder:
npm install
------------------------------------
How to automatically test the app:
This project uses unit tests. Run this command:
npm test
-------------------------------------
How to run:
npm start
-------------------------------------
Example endpoints:
http://localhost:3000/book/
http://localhost:3000/book/1/
http://localhost:3000/book/1/page/1
http://localhost:3000/book/1/page/3/html