RESTful API for taking notes on books
Each resource can be created, read, updated, and deleted with the right HTTP VERB. Each resource is assigned a unique ID when created. I used sequelize ORM to abstract the data model across databases. The data types used in the resource definitions are here
Users can be accessed at /api/user/[USER_ID]
User = {
username: STRING,
email: STRING
}
Books can be accessed at /api/user/USER_ID/book/[BOOK_ID]
Book = {
name: STRING,
isbn: CHAR(13),
lastPg: INTEGER
}
Notes can be accessed at /api/user/USER_ID/book/BOOK_ID/note/[NOTE_ID]
Note = {
title: STRING,
pg: STRING,
endPg: STRING,
content: TEXT // (long-form string)
}
git checkout https://github.com/dantheman0207/books-api.git
cd books-api
npm install
npm test
npm start
For testing, the app uses an in-memory sqlite database. For development, it uses a local Postgres database. Before running in development, change the settings in config.json