A Pet Store application with Node.js(ES6), Express framework, Mocha/chai(Test Case integration)
- Clone the repo
- Run "npm install command" to install add the dependencies.
- Run "npm start" command to start the NodeJS server.
- After starting server , you can visit
http://localhost:1005/api-docs/
to check the apis.
- You can run test cases by this command "npm test"
- It will show you how many test cases are passed or failed.
1.) ApI Name :- /owners (GET) This api is used to fetch all owners.
2.) API name:- /owners/1 (GET) This api is used to get the single owner information with their pet.
3.) Api Name :- /addPet (POST) This api is used to add a new pet in the json file.
4.) Api Name :- /pets/1 (GET) This api is used to get a single pet information with their owner.
./test
- this folder contains integration tests [Mocha]
./
controllers
are route handlers that haverequest
andresponse
parameters.routes
are RESTful route declarations using [express server module]datastore
contains the json fileindex.js
is the entrypoint that actually starts the Express server
- Using eslint for code style
- Using NodeJS witj ES6.
- Using Mocha/chai for test case integration.
- Authentication is not needed.
- Config is not needed as its a small application and doesnt contains database.
- I havent put much comments in the code as its readable itself.
- Only integration tests are available in this repository.