-
Notifications
You must be signed in to change notification settings - Fork 0
/
Constants.cs
36 lines (31 loc) · 1.61 KB
/
Constants.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using Microsoft.Extensions.Configuration;
namespace Kvin.Short
{
public static class Constants
{
public readonly static string Favicon = "favicon.ico";
public static class ConfigurationKeys
{
public readonly static string CreateLinkPageUrl = "Shorter:CreateLinkPageUrl";
public readonly static string DataStoreApiUrl = "Shorter:DataStoreApiUrl";
public readonly static string DataStoreHostKey = "Shorter:DataStoreHostKey";
public readonly static string ForwardLinkUrl = "Shorter:ForwardLinkUrl";
}
public static class Configuration
{
public static string CreateLinkPageUrl => Startup.StaticConfig.GetValue<string>(Constants.ConfigurationKeys.CreateLinkPageUrl);
public static string DataStoreApiUrl => Startup.StaticConfig.GetValue<string>(Constants.ConfigurationKeys.DataStoreApiUrl);
public static string DataStoreHostkey => Startup.StaticConfig.GetValue<string>(Constants.ConfigurationKeys.DataStoreHostKey);
public static string ForwardLinkUrl => Startup.StaticConfig.GetValue<string>(Constants.ConfigurationKeys.ForwardLinkUrl);
}
public static class FunctionUrls
{
public static string GetLink(string name) {
return $"{Configuration.DataStoreApiUrl}/GetLink?code={Configuration.DataStoreHostkey}&{nameof(Link.Key)}={name}";
}
public static string CreateLink() {
return $"{Configuration.DataStoreApiUrl}/CreateLink?code={Configuration.DataStoreHostkey}";
}
}
}
}