API for bibliophiles
To install this api, fork or clone this repository and run the command:
$ npm i
This should install the dependencies.
The database is MongoDB.
In the repository there is a sample environment file, under ~/.env.sample
. This file should be duplicated and renamed to simply .env
. Then , the variables should be filled out, using the sample as a guide.
To Run the Server, run the command in your command line:
$ npm start
This will start the server.
Each section of the api has a .rest
file which shows sample api calls. You can test these routes yourself using these .rest
files by using the VS Code extension REST Client
. Click on Send Request
in VS Code to run the api call (your server must be running).
I haven't created any tests yet (or I have but haven't talked about them here because I am lazy to update the documentation...), but I am planning to use the Mocha
testing framework with Chai
.
To run all the tests, run the code:
$ npm test
Bibliofile Api is build using Typescript! Mainly because I enjoy types and want to learn more typescript.
MongoDB has been chosen for the database because I had some troubles with PostgreSQL on my computer. Heh. Yeah. I am using that Cloud Atlas service to host my production database, as they have a free tier.
This has been a learning exercise for me. Here are some of the resources I've been using, for future reference to refer back to if I need to: