Web API for HIH, built on ASP.NET Core.
This Web API was deployed on Microsoft Azure for testing purpose: https://achihapi.azurewebsites.net
To install this Web API to your own server, please follow the steps below.
You can clone this repository or download it.
You need setup your own database (SQL Server based), and run three sqls under folder 'sql':
- DBSchema_Table.sql
- DBSchema_View.sql
- Predliver_Content.sql
The appsettings.json has been removed because it defines the connection strings to the database. This file is manadatory to make the API works.
An example file look like following:
{
"ConnectionStrings": {
"DefaultConnection": "Data Source=XXX;Initial Catalog=XXX;Persist Security Info=True;User ID=XXX;Password=XXX;",
"DebugConnection": "Server=XXX;Database=XXX;Integrated Security=SSPI;MultipleActiveResultSets=true"
},
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Debug",
"System": "Information",
"Microsoft": "Information"
}
}
}
Deploy this Web API to IIS or other HTTP server.
Though the whole project developed and tested with Visual Studio 2019 Community Version and Visual Studio Code, the project can be processed by other IDE which supports ASP.NET Core.
Test project hihapi.test
has been added to solution. And the Travis CI has been integrated with this repo.
Test project hihapi.test
contains both Unit Test and Integration Test, you have to run Unit Test and Integration Test separately. The Travis CI also coverages the unit tests part due to the VM setting is not suit for Identity Server setup.
To run the unit test via command line:
dotnet test --filter DisplayName~hihapi.test.UnitTests
To run the integration test via command line:
dotnet test --filter DisplayName~hihapi.test.integrationtests
Alva Chien (Hongjun Qian) | 钱红俊
A programmer, and a certificated Advanced Photographer.
Contact me:
- Via mail: alvachien@163.com. Or,
- Check my flickr.
MIT