본문으로 바로가기
시놀로지용 deploy설정 및 startup.cs 상세 ASP.net core mvc - 바보처럼코딩하기

시놀로지용 deploy설정 및 startup.cs 상세 ASP.net core mvc

반응형

 

startup.cs 파일

 

using System;

using System.Collections.Generic;

using System.Linq;

using System.Threading.Tasks;

using Microsoft.AspNetCore.Builder;

using Microsoft.AspNetCore.Hosting;

using Microsoft.AspNetCore.Http;

using Microsoft.AspNetCore.Mvc;

using Microsoft.Extensions.Configuration;

using Microsoft.Extensions.DependencyInjection;

using Microsoft.Extensions.Logging;

 

namespace Csvk

{

public class Startup

{

public Startup(IConfiguration configuration)

{

Configuration = configuration;

}

 

public IConfiguration Configuration { get; }

 

// This method gets called by the runtime. Use this method to add services to the container.

public void ConfigureServices(IServiceCollection services)

{

 

services.AddResponseCaching(options =>

{

options.UseCaseSensitivePaths = true;

options.MaximumBodySize = 1024;

});

 

services.AddMvc();

 

// DI 의존성주입

 

// Session - 서비스에 등록함.

services.AddSession();

 

// 응답캐싱

services.AddResponseCaching();

 

}

 

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.

public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)

{

if (env.IsDevelopment())

{

app.UseDeveloperExceptionPage();

}

else

{

app.UseExceptionHandler("/Home/Error");

// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.

//app.UseHsts();

}

 

app.UseStaticFiles();

app.UseCookiePolicy();

// Application에 사용하겠다.

app.UseSession();

 

// 응답캐싱사용

app.UseResponseCaching();

 

app.UseMvc(routes =>

{

routes.MapRoute(

name: "default",

template: "{controller=Home}/{action=Index}/{id?}");

});

}

}

}

 

블리시 설정

 

 

 

반응형
  • 네이버 블로그 공유
  • 네이버 밴드 공유
  • 페이스북 공유
  • 카카오스토리 공유