Created dotnet2.0 Builder Image and Added /v2/specialized Endpoint to dotnet2.0 Envrionment (#1001)

This commit is contained in:
Paras Patidar
2019-05-15 16:35:55 +08:00
committed by Ta-Ching Chen
parent 56fa8fe766
commit 4632269314
35 changed files with 1973 additions and 5 deletions
+17
View File
@@ -4,11 +4,14 @@ using System.IO;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using Nancy;
using Newtonsoft.Json;
namespace Fission.DotNetCore.Api
{
public class FissionContext
{
public string PackagePath { get; set; }
public FissionContext(Dictionary<string, object> args, Logger logger, FissionHttpRequest request)
{
if (args == null) throw new ArgumentNullException(nameof(args));
@@ -31,6 +34,20 @@ namespace Fission.DotNetCore.Api
logger,
new FissionHttpRequest(request));
}
//this is to support aditional setting file read from source/deployment package via function
public T GetSettings<T>(string relativePath)
{
var filePath = Path.Combine(this.PackagePath, relativePath);
Console.WriteLine($"Going to Get Setting from :{filePath}");
string json = GetSettingsJson(filePath);
return JsonConvert.DeserializeObject<T>(json);
}
private string GetSettingsJson(string relativePath)
{
return File.ReadAllText(Path.Combine(this.PackagePath, relativePath));
}
}
public class Logger