You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
812 B
30 lines
812 B
using System;
|
|
using Nancy;
|
|
using Nancy.Security;
|
|
|
|
namespace NzbDrone.Api.Frontend
|
|
{
|
|
public class IndexModule : NancyModule
|
|
{
|
|
public IndexModule()
|
|
{
|
|
//Serve anything that doesn't have an extension
|
|
Get[@"/(.*)"] = x => Index();
|
|
}
|
|
|
|
private object Index()
|
|
{
|
|
if(
|
|
Request.Path.Contains(".")
|
|
|| Request.Path.StartsWith("/static", StringComparison.CurrentCultureIgnoreCase)
|
|
|| Request.Path.StartsWith("/api", StringComparison.CurrentCultureIgnoreCase)
|
|
|| Request.Path.StartsWith("/signalr", StringComparison.CurrentCultureIgnoreCase))
|
|
{
|
|
return new NotFoundResponse();
|
|
}
|
|
|
|
|
|
return View["UI/index.html"];
|
|
}
|
|
}
|
|
} |