- Authentication
- Swagger
- Docker compose
- Hangfire for background tasks
- Logging
-
Ctrl + Shift + P to run tasks
- Tasks: Run Build Task (also Ctrl + Shift + B)
- Tasks: Run Test Task
- Tasks: Run Task
- select build, run or test
- If running, choose Tasks: Terminate Running Task to stop task
-
Debug
- Debug menu and start .NET Core Launch (web)
# Run API
$ dotnet run -p src/MapApi/
# Execute tests
$ dotnet test test/MapApi.Tests/
# Run API with watch (run from src/MapApi)
$ dotnet watch run
Open MapiApi.sln
# Postgres
# Get Postgres image
$ docker pull postgres
# Run image with map-db database
$ docker run --name map-postgres -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=pwd -e POSTGRES_DB=map-db -d -p 5432:5432 postgres
# Own docker for unit test
$ docker run --name map-postgres-ut -e POSTGRES_USER=mapuser -e POSTGRES_PASSWORD=pwd -e POSTGRES_DB=map-db-ut -d -p 5433:5432 postgres
$ curl http://localhost:5000/api/map/location
$ curl http://localhost:5000/api/map/markers
$ curl -H "Content-Type: application/json" -X POST -d '{ "mapId": "", "lat": 60.170,"long": 24.940, "description": "hello 44"}' http://localhost:5000/api/markers
$ curl -H "Content-Type: application/json" -X DELETE -d '{ "mapId": "", "lat": 60.170,"long": 24.940, "description": "hello 44"}' http://localhost:5000/api/markers
TODO: Docker compose:
# In project root
$ docker-compose up
Or start MapApi docker:
# Build in src/MapApi
$ docker build -t web .
# Run
$ docker run -it -p 5000:5000 web
# Remeber to run postgres docker
Licensed under the MIT License.