sonarr-repo-only/NzbDrone.Api/Frontend/IndexModule.cs

28 lines
692 B
C#
Raw Normal View History

using System;
using Nancy;
namespace NzbDrone.Api.Frontend
{
public class IndexModule : NancyModule
{
public IndexModule()
{
2013-02-18 03:04:28 +00:00
//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))
{
return new NotFoundResponse();
}
2013-03-29 01:49:14 +00:00
return View["UI/index.html"];
}
}
}