- Install MySQL
- Install Node.js
- Optional: Install Docker
- Optional: Install Postman
- Optional: Install cURL
- Run mysql scripts to create and populate a sample DB (see
mysql.sql)
This API is pre-configured to connect to a localhost DB. If you wish to connect to a different DB, update config/db.json as needed.
- Clone this repo
- Install modules
npm i - Run the app
node start - Test api: http://localhost:3000/healthz
By default this API runs in port 3000.
- Clone this repo
- Under
config/db.json, if you DB is running locally change host to your localhost hostname. If it's running somewhere else, change it to the corresponding hostname. - Build image
docker build -t kenzan . - Run image
docker run --name kenzan_code_challenge -d -p 3000:3000 kenzan - Test api: http://localhost:3000/healthz
- If you have Postman installed, import
postman_collection.json(change hostname as needed). - If you have cURL installed, open
curl-examples.txtand execute API calls examples in your terminal (change hostname as needed).
TODO: Add Swagger
This excersie is based and adapted usgin my very own API Generator (work in progress). Feel free to try it here.