初始化
This commit is contained in:
42
MQTTServerSideAPI/App_Start/BundleConfig.cs
Normal file
42
MQTTServerSideAPI/App_Start/BundleConfig.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using System.Web;
|
||||
using System.Web.Optimization;
|
||||
|
||||
namespace MQTTServerSideAPI
|
||||
{
|
||||
public class BundleConfig
|
||||
{
|
||||
// 有关捆绑的详细信息,请访问 https://go.microsoft.com/fwlink/?LinkId=301862
|
||||
public static void RegisterBundles(BundleCollection bundles)
|
||||
{
|
||||
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
|
||||
"~/Scripts/jquery-{version}.js"));
|
||||
|
||||
// 使用要用于开发和学习的 Modernizr 的开发版本。然后,当你做好
|
||||
// 生产准备就绪,请使用 https://modernizr.com 上的生成工具仅选择所需的测试。
|
||||
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
|
||||
"~/Scripts/modernizr-*"));
|
||||
|
||||
/*bundles.Add(new Bundle("~/bundles/bootstrap").Include(
|
||||
"~/Scripts/bootstrap.js"));
|
||||
|
||||
bundles.Add(new Bundle("~/bundles/bootstrap").Include(
|
||||
"~/Scripts/jquery.dataTables.min.js"));
|
||||
bundles.Add(new Bundle("~/bundles/bootstrap").Include(
|
||||
"~/Scripts/dataTables.bootstrap.min.js"));*/
|
||||
|
||||
bundles.Add(new Bundle("~/bundles/bootstrap").Include(
|
||||
"~/Scripts/bootstrap.bundle.min.js",
|
||||
"~/Scripts/jquery.dataTables.min.js",
|
||||
"~/Scripts/dataTables.bootstrap.min.js",
|
||||
"~/admin-lte/js/adminlte.min.js"));
|
||||
|
||||
bundles.Add(new StyleBundle("~/Content/css").Include(
|
||||
"~/Content/bootstrap.css",
|
||||
"~/Content/font-awesome.min.css",
|
||||
"~/Content/dataTables.bootstrap.min.css",
|
||||
"~/admin-lte/css/AdminLTE.min.css",
|
||||
"~/admin-lte/css/skins/_all-skins.min.css",
|
||||
"~/Content/site.css"));
|
||||
}
|
||||
}
|
||||
}
|
||||
13
MQTTServerSideAPI/App_Start/FilterConfig.cs
Normal file
13
MQTTServerSideAPI/App_Start/FilterConfig.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace MQTTServerSideAPI
|
||||
{
|
||||
public class FilterConfig
|
||||
{
|
||||
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
|
||||
{
|
||||
filters.Add(new HandleErrorAttribute());
|
||||
}
|
||||
}
|
||||
}
|
||||
23
MQTTServerSideAPI/App_Start/RouteConfig.cs
Normal file
23
MQTTServerSideAPI/App_Start/RouteConfig.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
|
||||
namespace MQTTServerSideAPI
|
||||
{
|
||||
public class RouteConfig
|
||||
{
|
||||
public static void RegisterRoutes(RouteCollection routes)
|
||||
{
|
||||
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
|
||||
|
||||
routes.MapRoute(
|
||||
name: "Default",
|
||||
url: "{controller}/{action}/{id}",
|
||||
defaults: new { controller = "LoginViews", action = "Index", id = UrlParameter.Optional }
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
29
MQTTServerSideAPI/App_Start/WebApiConfig.cs
Normal file
29
MQTTServerSideAPI/App_Start/WebApiConfig.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace MQTTServerSideAPI
|
||||
{
|
||||
public static class WebApiConfig
|
||||
{
|
||||
public static void Register(HttpConfiguration config)
|
||||
{
|
||||
// Web API 配置和服务
|
||||
|
||||
// Web API 路由
|
||||
config.MapHttpAttributeRoutes();
|
||||
|
||||
config.Routes.MapHttpRoute(
|
||||
name: "DefaultApi",
|
||||
routeTemplate: "api/{controller}/{id}",
|
||||
defaults: new { id = RouteParameter.Optional }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user