我实现了一个 asp.net 核心 API 2.2。我已经创建了一个 docker 镜像。我想覆盖 appsettings.json 文件中的连接字符串。
有什么办法吗?当我使用命令启动容器时,我尝试通过环境变量docker container run -e "ConnectionStrings:DefaultConnection={...here goes the connection string}"
builder.AddEnvironmentVariables();我的 Startup.cs 中也有,但我的 appsetting.json 中的连接字符串没有被替换。
我在容器内检查了它,appsetting.json 在那里,但值没有被替换。
任何其他方式如何处理这种情况?谢谢。
我正在开发 Angular 6 应用程序。目前我正在为路由而苦苦挣扎。我感兴趣的是,我的结构,我想象的是否可行。所以它看起来像这样:
应用程序模块 - 包含主路由和一些父路由,其中定义了布局。像这样:
const routes: Routes = [
{
path: 'login',
component: LoginComponent
},
{
path: '',
component: LayoutComponent,
canActivate: [AuthGuard],
canActivateChild: [AuthGuard],
children: [
// {
// path: 'brands',
// loadChildren: 'app/modules/brands/brands.module#BrandsModule',
// pathMatch: 'prefix'
// }
]
}
];
@NgModule({
imports: [RouterModule.forRoot(routes), BrandsModule, ItemsModule],
exports: [RouterModule],
providers: [BosRouteLoader]
})
export class RoutingModule {}
Run Code Online (Sandbox Code Playgroud)
我的一个功能模块在模块中定义了自己的路由,如下所示:
const routes: Routes = [
{
path: 'brands',
children: [
{ path: '', component: BrandListComponent },
{ path: ':id', component: …Run Code Online (Sandbox Code Playgroud)