An API interface for customers who need to consume test data.
-
Install Docker
https://docs.docker.com/install/
-
Clone the repo
$ git clone https://github.com/cmaloney7/test-data-store.git
-
Change directory to the folder 'test-data-store'
$ cd test-data-store
To start this api up and start using it, do the following. Note, this is for API use only and not development.
-
Run the following command to start up api and dependant stack (node, mongo and test-data-store API)
$ bash docker.start.sh
-
The test-data-store API should now be running. Access the API and Swagger page via the section below 'Using the API Server' or use the Postman collection.
When you are done using the api, stop the container by running the following bash script.
$ bash docker.stop.sh
To start this api up and continue development, do the following.
-
Install node modules
$ npm install
-
Run the following command to start up api and dependant stack (node, mongo, mongo-express and test-data-store API)
$ bash docker.start.dev.sh
-
The test-data-store API should now be running. Open the repo in your preferred IDE for further development, git management, testing, etc.
When you are done using the development containers, stop them by running the following bash script.
$ bash docker.stop.dev.sh
When you are finished with new development, you may want to update the production image to the public Docker repo.
To create a new image and publish, run the following bash script.
Note, you'll need to know the password for the Docker repo to complete this.
Also, this process can be automated in your CI/CD pipeline.
$ bash docker.push.sh
test-data-store URL - http://localhost:12700
Swagger URL - http://localhost:12700/api-docs
Mongo Express URL - http://localhost:8081 (Note, mongo-express should only be used privately for development purposes. That being said, it is only available when using Developer Setup)
Import the following into postman for use and/or testing: ./postman/node-api-boiler.postman_collection.json
OpenAPI Specification - https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
Swagger Builder - https://inspector.swagger.io/builder