File tree Expand file tree Collapse file tree 4 files changed +19
-16
lines changed
Expand file tree Collapse file tree 4 files changed +19
-16
lines changed Original file line number Diff line number Diff line change @@ -32,16 +32,29 @@ public class Startup
3232 public Startup ( IConfiguration configuration , IHostingEnvironment env )
3333 {
3434 Configuration = configuration ;
35+ Env = env ;
3536 }
3637
3738 public IConfiguration Configuration { get ; }
39+ public IHostingEnvironment Env { get ; }
3840
3941 // This method gets called by the runtime. Use this method to add services to the container.
4042 public void ConfigureServices ( IServiceCollection services )
4143 {
42- string SecretKey = Configuration [ "AppSecret" ] ;
43- // string SecretKey = "141FE29A91D7FA1A13F3C713BB789";
44- SymmetricSecurityKey _signingKey = new SymmetricSecurityKey ( Encoding . ASCII . GetBytes ( SecretKey ) ) ;
44+ string secretKey = string . Empty ;
45+
46+ if ( Env . IsDevelopment ( ) )
47+ {
48+ // Get secret key from dotnet user secrets.
49+ secretKey = Configuration [ "AppSecret" ] ;
50+ }
51+ else
52+ {
53+ // Set up secretkey for production.
54+ secretKey = "__YOUR_PRODUCTION_SECRET_KEY__" ;
55+ }
56+
57+ SymmetricSecurityKey _signingKey = new SymmetricSecurityKey ( Encoding . ASCII . GetBytes ( secretKey ) ) ;
4558
4659 // Add framework services.
4760 services . AddDbContext < ApplicationDbContext > ( options =>
Original file line number Diff line number Diff line change 22<configuration >
33 <system .webServer>
44 <modules >
5- <remove name =" WebDAVModule" />
5+ <!-- Allow PUT,DELETE,ETC request headers -->
6+ <remove name =" WebDAVModule" />
67 </modules >
78 <handlers >
89 <add name =" aspNetCore" path =" *" verb =" *" modules =" AspNetCoreModule" resourceType =" Unspecified" />
910 </handlers >
10- <aspNetCore processPath =" dotnet" arguments =" .\WebApi.dll" stdoutLogEnabled =" false " stdoutLogFile =" .\logs\stdout" />
11+ <aspNetCore processPath =" dotnet" arguments =" .\WebApi.dll" stdoutLogEnabled =" true " stdoutLogFile =" .\logs\stdout" />
1112 </system .webServer>
1213</configuration >
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments