A RESTful API for managing and calculating currency rates built using .Net 5.
In order to run this application, you'll need to edit the appDataSettings.json
file.
Example data configuration file:
{
"ConnectionString": "Server=127.0.0.1;Port=3306;Database=currency_api;AllowUserVariables=True;User Id=root;",
"DataProvider": "MySql",
"EnableSensitiveDataLogging": true,
"RawDataSettings": {}
}
- The connection string should be in the format supported the respective provider. More info
- The supported providers are
MySql
,SqlServer
andPostgres
.
Note: There is no need for pre-installing a runtime as the executables are bulit as self-contained
- Download the windows archive from the releases page
- Extract the downloaded archive to the desired directory
- Replace {publish dir} with the export directory and run the following command
env:DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1; {publish dir}/CurrencyApi.Presentation.exe --urls http://127.0.0.1:5000
- Download the linux archive from the releases page
- Extract the downloaded archive to the desired directory
- Replace {ver} with the downloaded version and {publish dir} with the export directory
- Run the following commands
Install dependencies: unzip
unzip currency-api-v{ver}-linux-amd64.zip -d {publish dir}
chmod +x {publish dir}/CurrencyApi.Presentation
cd {publish dir}
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1 ./CurrencyApi.Presentation --urls http://127.0.0.1:5000
Next After run
Note: When running in debug mode the migrations have to be applied manually. To apply the migrations manually please run the following command, in the parent directory of the project.
dotnet ef database update --startup-project .\Src\CurrencyApi.Presentation\
More info: Entity Framework Core tools reference - .NET Core CLI
After starting the application you should be automatically directed at the swagger ui. If this doesn't happen you can navigate manualy by typing {BaseUrl}/swagger in your preferred browser.
In order to use the api you must first login. The default credentials are:
-
Admin user:
- username:
admin
- password:
defaultAdminPass1!
- username:
-
Simple user:
- username:
user
- password:
defaultUserPass1!
- username: