mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-10-31 07:52:37 +01:00
30 lines
770 B
C#
30 lines
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"];
|
|
}
|
|
}
|
|
} |