Skip to content

A simple RESTful API built using Node.js, MySQL with Docker compose

License

Notifications You must be signed in to change notification settings

codezri/node-rest-api-demo

Repository files navigation

node-rest-api-demo

A simple RESTful API built using Node.js, MySQL with Docker compose

How to start the RESTful API

Make sure your computer has a newer version of Docker with Docker Compose CLI before running this project. Clone the repository with the following command:

git clone https://github.com/codezri/node-rest-api-demo.git
cd node-rest-api-demo

Start Docker Compose services:

docker-compose up -d

Once the MySQL and Node.js containers are up, you can access the API with the following URL:

http://localhost:5000

How to run load tests

This project uses the Artillery test runner to run load tests. First, install the Artillery CLI into your computer:

npm install -g artillery@latest
# --- or ---
yarn global add artillery@latest

Make sure the web service works by sending a simple HTTP request as follows:

curl http://localhost:5000

Run the load test suite:

npm run load-test
# --- or ---
yarn load-test

Credits

Thanks Jeremy Morgan for creating this public Gist. I added US state details to the demo_db.sql file using that Gist's content.

License

MIT

About

A simple RESTful API built using Node.js, MySQL with Docker compose

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published