- Copy the example config:
cp appsettings.Development.json.example appsettings.Development.json
-
Update
ConnectionStrings:DefaultandJwt:Keyinappsettings.Development.json. -
Initialize database with the provided SQL in
INITDB.md. -
Run the API:
dotnet run
appsettings.Development.jsonis ignored by git for safety.- Swagger UI is available at
/swaggerin Development.
Build:
docker build -t easy_record_working_api:latest .
Run (set your own values):
docker run -p 8080:8080 ^
-e ConnectionStrings__Default="Server=127.0.0.1;Port=3306;Database=easy_record_working;User ID=root;Password=your_password;" ^
-e Jwt__Issuer="EasyRecordWorkingApi" ^
-e Jwt__Audience="EasyRecordWorkingApi" ^
-e Jwt__Key="ReplaceWithAStrongKeyAtLeast32Chars" ^
-e Jwt__ExpiresMinutes=720 ^
easy_record_working_api:latest
The API reads configuration from environment variables by default.
Use __ to map to nested settings, for example:
ConnectionStrings__Default=...
Jwt__Issuer=EasyRecordWorkingApi
Jwt__Audience=EasyRecordWorkingApi
Jwt__Key=ReplaceWithAStrongKeyAtLeast32Chars
Jwt__ExpiresMinutes=720