sj-freitas / depinj-express-example

An example express app using the depinj-express integration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

depinj-express-example

An express app example with an integration of depinj.

Usage

  1. Clone this repository.
  2. Run yarn to install the dependencies.
  3. Run yarn build to compile the code.
  4. Run yarn start to spin the server.

Requests

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'

Behaviors

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!

About

An example express app using the depinj-express integration

License:MIT License


Languages

Language:TypeScript 98.2%Language:JavaScript 1.8%