This is a Node.js Express version of the Hit Counter service
This application contains a Node.js Express backend that demonstrates a simple hit counter API. It's a RESTful service that tracks the number of hits to a URL.
- Express.js web framework
- Swagger UI for API documentation
- Mocha/Chai for testing
- Docker support for development and deployment
-
Install dependencies:
npm install
-
Start the server:
npm start
Or for development with auto-reload:
npm run dev
-
Access the application at http://localhost:8000
-
Build the Docker image:
docker build -t express-hit-counter .
-
Run the container:
docker run -p 8000:8000 express-hit-counter
GET /hits
- Get the current hit countPUT /hits
- Increment the hit counter by 1
npm test
For coverage report:
npm run coverage
Copyright (c) IBM Corporation. All rights reserved.