allow separate configuration of app resources path

This commit is contained in:
Luke Pulverenti
2014-11-26 15:57:16 -05:00
parent 17081767da
commit 63a0d52fd1
7 changed files with 25 additions and 29 deletions

View File

@@ -1,4 +1,4 @@
using MediaBrowser.Common.Configuration;
using MediaBrowser.Controller;
using MediaBrowser.Controller.Net;
using ServiceStack.Web;
using System.IO;
@@ -7,9 +7,9 @@ namespace MediaBrowser.Server.Implementations.HttpServer
{
public class SwaggerService : IHasResultFactory, IRestfulService
{
private readonly IApplicationPaths _appPaths;
private readonly IServerApplicationPaths _appPaths;
public SwaggerService(IApplicationPaths appPaths)
public SwaggerService(IServerApplicationPaths appPaths)
{
_appPaths = appPaths;
}
@@ -21,9 +21,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer
/// <returns>System.Object.</returns>
public object Get(GetSwaggerResource request)
{
var runningDirectory = Path.GetDirectoryName(_appPaths.ApplicationPath);
var swaggerDirectory = Path.Combine(runningDirectory, "swagger-ui");
var swaggerDirectory = Path.Combine(_appPaths.ApplicationResourcesPath, "swagger-ui");
var requestedFile = Path.Combine(swaggerDirectory, request.ResourceName.Replace('/', Path.DirectorySeparatorChar));