Example of a Counter with Sharpino
Prerequisites: dbmate, postgres (optional as can use in memory eventstore)
clone project
then run the commands:
dbmate up
and run the following command:
dotnet run
Create a file named .env with content like this (substituting the postgresusername/postgrespassword with your own):
DATABASE_URL="postgres://postgresusername:[email protected]:5432/es_counter?sslmode=disable"
then uncomment the following line in the Tests.fs: // ((fun () -> SharpinoCounterApi (pgStorage, doNothingBroker, counterContextStorageStateViewer, counterAggregateStorageStateViewer)), pgStorage) and optionally comment out the following line in the Tests.fs: // ((fun () -> SharpinoCounterApi (memoryStorage, doNothingBroker, counterContextStorageStateViewer, counterAggregateStorageStateViewer)), memoryStorage)
then run the commands:
dbmate up
and run the following command:
dotnet run
A 6 min reading article about this example can be found here