This repository was archived by the owner on Dec 4, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 877
/
Copy pathstartup.ts
49 lines (43 loc) · 1.55 KB
/
startup.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// #docregion redirect
app.UseStaticFiles(new StaticFileOptions
{
RequestPath = new PathString("/app"),
FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), "app"))
});
app.UseStaticFiles(new StaticFileOptions
{
RequestPath = new PathString("/node_modules"),
FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), "node_modules"))
});
// #enddocregion redirect
// #docregion redirect-using
using Microsoft.Extensions.FileProviders;
using System.IO;
// #enddocregion redirect-using
// #docregion lowercaseurls
services.Configure<RouteOptions>(options => options.LowercaseUrls = true);
// #enddocregion lowercaseurls
// #docregion lowercaseurls-using
using Microsoft.AspNetCore.Routing
// #enddocregion lowercaseurls-using
// #docregion route-default
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
});
// #enddocregion route-default
// #docregion route-new
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
routes.MapRoute(
name: "angular",
template: "app/{*routes}",
defaults: new { controller = "App", action = "Index" }
);
});
// #enddocregion route-new