Test microservice using ExpressJS
- Ensure you have GIT installed locally.
- Ensure you have Node 16.15.1 LTS installed
- Ensure you have Brew installed (for MacOS only)
- Clone the repository with the following command:
git clone https://github.com/isaiah-moran/express-example.git
- Navigate to the newly cloned repository
- Install dependencies with
npm install
- Start the app with
npm run dev
- Ensure you have Docker Desktop installed and running
- CD to the root of the
express-example
directory - Run the following in your terminal:
docker build -t express-example-docker .
- Run the following in your terminal:
docker run -p 3000:3000 express-example-docker
Once you've either set yourself up for local development or started running a built docker image of the website use postman or CURL and run GET request against the following endpoint: http://localhost:3000/v1/ping
This API has been instrumented with Nodemon when running in DEV mode which will trigger a re-compile and re-run. This is extremely helpful when dealing wth static assets like translations.
This API has been instrumented with Swagger, when running the API locally or via Docker the docs may be found by navigating to http://localhost:3000/api-docs. These docs are automatically generated on API start via syntax that can be found in the routes files.
If you're actively developing against multiple versions of Node it can be useful to install Node Version Manager (referred to as NVM). This can be found at the following site: https://github.com/nvm-sh/nvm