This is a tiny REST service managing counters. The counters are kept in memory, so they are reset every time you restart the service.
Each counter has
- a unique index (a number greater or equal 0) and
- a value.
You can either get or set a counter. Of course, you shouldn't set any counter in a distributed environment. Instead, you should get it and then use the increment or decrement operations on it. For presentations, it is a reasonable choice to set some counters before showing anything to your audience.
The RESTful Web Service runs at http://localhost:3000. Its Swagger UI is available at http://localhost:3000/swagger-ui/.
$ yarn install
# development
$ yarn start
# watch mode
$ yarn start:dev
# production mode
$ yarn start:prod
# unit tests
$ yarn test
# e2e tests
$ yarn test:e2e
# test coverage
$ yarn test:cov
This is only one possible solution to this kind of problem.
There are some implementations of single-page applications using the services which are implemented in different programming languages and frameworks.
Here's the full picture.
- https://github.com/MichaelKaaden/redux-client-ngrx (Angular with NgRx)
- https://github.com/MichaelKaaden/redux-client-ng5 (Angular
with
angular-redux
) - https://github.com/MichaelKaaden/redux-client-ng (AngularJS
with
ng-redux
)
- https://github.com/MichaelKaaden/redux-server-spring (Java with Spring Boot)
- https://github.com/MichaelKaaden/redux-server-rust (Rust
with
actix-web
) - https://github.com/MichaelKaaden/redux-server-golang (Go
with
Gin
) - https://github.com/MichaelKaaden/redux-server-nest (Node.js
with
Nest.js
) - https://github.com/MichaelKaaden/redux-server (Node.js with
Express
)