An express app example with an integration of depinj.
- Clone this repository.
- Run
yarn
to install the dependencies. - Run
yarn build
to compile the code. - Run
yarn start
to spin the server.
Do the following curls:
- Increment counter:
curl -I --request POST --url 'http://localhost:3000/counter'
- Check value of counter:
curl --request GET --url 'http://localhost:3000/counter'
If you add query parameters to the request, the request will respond with a 400 and it will log an error. All requests are logged with a unique-id per request. If the same request has more than one log, the id will be the same. The ID is generated on demand, so any service that depends on RANDOM_UUID will always have a different one per instance. The counter is configured as a singleton, as long as the app is alive it will keep its state globally.
Enjoy!