Simple Bookstore is a RESTful API built in Express.js and using PostgreSQL to store data. It follows CRUD principles and consists of the following routes:
- /books/create - create a new book (create)
- /books - list all books (read)
- /books/:id - retrieve a particular book (read)
- /books/edit/:id - update a particular book (update)
- /books/delete/:id - delete a particular book (delete)
You must have Node, Node Package Manager and PostgreSQL installed on your local machine.
- Fork and clone the repository.
npm install
to get the required dependencies.npm run init:db
to create, load, and seed the database.- You will need to create your own .env file within the project with the following line:
DATABASE_URL="postgres://localhost:5432/bookstore"
npm start
to start the server, ornpm run start:dev
to run it in development mode with nodemon.
To run unit tests for the API queries, just run npm test
after installing the dependencies. Tests are implemented in Mocha/Chai.
This project is set up for live deployment.
This project is licensed under the MIT License.