1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-28 02:27:13 +00:00
Lidarr/NzbDrone.Api/FrontendModule/IndexModule.cs
2013-02-17 19:04:28 -08:00

30 lines
No EOL
770 B
C#

using System;
using System.Linq;
using Nancy;
using Nancy.Responses.Negotiation;
namespace NzbDrone.Api.FrontendModule
{
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["NzbDrone.Backbone/index.html"];
}
}
}