mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
using pre-compiled handlebar templates
re-did static content from nancy
This commit is contained in:
28
NzbDrone.Api/Frontend/IndexModule.cs
Normal file
28
NzbDrone.Api/Frontend/IndexModule.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
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"];
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user