initial commit
This commit is contained in:
41
Web/Startup.cs
Normal file
41
Web/Startup.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using Microsoft.Owin;
|
||||
using Microsoft.Owin.StaticFiles;
|
||||
using Owin;
|
||||
using System.Web.Http;
|
||||
using VNCServerList.Web.Controllers;
|
||||
|
||||
namespace VNCServerList.Web
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
public void Configuration(IAppBuilder app)
|
||||
{
|
||||
// Web API 설정
|
||||
var config = new HttpConfiguration();
|
||||
|
||||
// 라우팅 설정
|
||||
config.MapHttpAttributeRoutes();
|
||||
|
||||
config.Routes.MapHttpRoute(
|
||||
name: "DefaultApi",
|
||||
routeTemplate: "api/{controller}/{action}/{id}",
|
||||
defaults: new { id = RouteParameter.Optional }
|
||||
);
|
||||
|
||||
// JSON 포맷터 설정
|
||||
config.Formatters.JsonFormatter.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore;
|
||||
|
||||
app.UseWebApi(config);
|
||||
|
||||
// 정적 파일 서빙 설정
|
||||
var options = new FileServerOptions
|
||||
{
|
||||
EnableDefaultFiles = true,
|
||||
DefaultFilesOptions = { DefaultFileNames = { "index.html" } },
|
||||
FileSystem = new Microsoft.Owin.FileSystems.PhysicalFileSystem("Web/wwwroot")
|
||||
};
|
||||
|
||||
app.UseFileServer(options);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user