1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-14 11:23:42 +02:00
Sonarr/NzbDrone.Api/Frontend/IndexModule.cs
kay.one 375f887539 using pre-compiled handlebar templates
re-did static content from nancy
2013-03-29 16:00:38 -07:00

28 lines
692 B
C#

using System;
using Nancy;
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))
{
return new NotFoundResponse();
}
return View["UI/index.html"];
}
}
}