An open API service indexing awesome lists of open source software.

https://github.com/json2d/bookr-api

backend for book sharing platform
https://github.com/json2d/bookr-api

Last synced: 3 months ago
JSON representation

backend for book sharing platform

Awesome Lists containing this project

README

        

# bookr-api
Check out the API doc [here]( https://bitstrider.github.io/bookr-api/), generated by [`apidoc`]

### Configuration
To run this app, you'll need to create a `.env` file in the root project directory to define the required environment variables. The file `sample.env` is included as a template:
```
PORT=3000
DB_URI=?

JWT_SECRET="this is a secret"
JWT_EXPIRE_IN_SECS=600

AWS_ACCESS_KEY_ID=?
AWS_SECRET_ACCESS_KEY=?
AWS_REGION=?
EMAIL_SENDER=?
```

Here are some descriptions for the less obvious ones:

- `DB_URI` - path to mongodb
- `JWT_SECRET` - key for signing tokens
- `JWT_EXPIRE_IN_SECS` - time to expiry for generated tokens
- `EMAIL_SENDER` - email address to send system message from

### Testing
Test cases written with [`mocha`](https://github.com/mochajs/mocha) and [`supertest`](https://github.com/visionmedia/supertest), with help from [`faker`](https://github.com/marak/Faker.js/). To in the console simply run:
```
$ npm i
$ npm test
```