A simple RESTful API built with hapijs, mongodb and nanobox
- MongoDB
- NodeJS (Version used == 8.7.0)
The project uses Code, Sinon and Lab for testing.
To run the tests:
$ yarn test
Import some data into MongoDB from test/data.json
or generate your own mockaroo
or go all in and explore the crunchbase api
Run
mongoimport -d crunchbase -c companies --file data.json --jsonArray
To start the server:
$ yarn start
The API uses jwt
authentication so the Authorization
header is required to access the data.
Using an app like Postman
:
-
Register with an email (can be fake but has to adhere to email syntax i.e.
[email protected]
) by visitinglocalhost:11001/v1/user/register
-
Login to receive access token which expires in 1 hour
localhost:11001/v1/user/login
Check out the docs for more details
Visit localhost:11001/documentation
to checkout documentation on a swaggerUI.
- Fork the repo
- Edit the code and write tests to verify your feature or bugfix
- Open a pull request