1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-09-20 00:11:46 +02:00
Radarr/NzbDrone.Api/Frontend/IndexModule.cs

29 lines
790 B
C#
Raw Normal View History

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