mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-14 11:23:42 +02:00
375f887539
re-did static content from nancy
28 lines
692 B
C#
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"];
|
|
}
|
|
}
|
|
} |