Bp dotnet core seed for microservices
Fork the repo to A new git repo, using the naming convention: bp-{SERVICE_NAME}-service
Rename the sln file in the new repo, to the service name, Bp{ServiceName}Service.sln
Rename in the Config\appsettings.json
the service info (version and name)
Under the component project, will be all of the microservice code Each component will be in A new folder, like Sample and Sample can be removed If some common dto's/functions/models are needed, it could also be added to Bp.Common package
Config is loaded into the project using netcore environment It assumes the config will be in directory in the main seed project and it will loads the configs by the order:
appsettings.json
appsettings.{Environment}.json
appsettings.{Environment}.local.json
and then the environment variables
Add default logger sinks for mattermost and splunk and console
For splunk logger have in the config:
{
"Serilog": {
...
"CustomLoggers": {
...
"SplunkLogger": {
"Protocol": "http",
"Host": "localhost",
"Port": "3000",
"Username": "Username",
"Password": "Password",
"SourceType": "SourceType",
"Index": "Index"
},
...
},
...
}
}
For mattermost logger have in the config:
{
"Serilog": {
...
"CustomLoggers": {
...
"MattermostLogger": {
"Protocol": "http",
"Host": "localhost",
"Port": "3000",
"Path": "bla/6"
},
...
},
...
}
}
Mattermost by default will get only logs from Error level Splunk by default will get only logs from Debug level
In appsettings.json change the config:
{
...
"Kestrel": {
"EndPoints": {
"Http": {
"Url": "http://*:{PORT}"
}
}
},
...
}
{
...
"Kestrel": {
"EndPoints": {
"Https": {
"Url": "https://*:{PORT}"
}
}
},
...
}
There is some default health checks for different dbs
{
...
"Data": {
"SqlServer": {
"ConnectionString": "{SQL_CONNECTION_STRING}"
}
},
...
}
{
...
"Data": {
"MongoDB": {
"ConnectionString": "{SQL_CONNECTION_STRING}"
}
},
...
}
Allow extending configure services of the ApiRunner Using reflection:
BpConfigureServices
ExtendConfigureServices
AND OR ExtendConfigure
IServiceCollection
, IConfiguration
for ExtendConfigureServices
and IApplicationBuilder
, IHostingEnvironment
, IConfiguration
for ExtendConfigure
)
If the class or one of the methods are null it just skip the null class or method