小编tha*_*dam的帖子

asp.net 核心通过 ENV 变量覆盖连接字符串

我实现了一个 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 在那里,但值没有被替换。

任何其他方式如何处理这种情况?谢谢。

c# docker asp.net-core

8
推荐指数
2
解决办法
1万
查看次数

在 Angular 6 中将路由拆分为单独的模块

我正在开发 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)

javascript routes typescript angular

3
推荐指数
1
解决办法
6074
查看次数

标签 统计

angular ×1

asp.net-core ×1

c# ×1

docker ×1

javascript ×1

routes ×1

typescript ×1