@@ -81,6 +81,7 @@ namespace Teknik | |||
// Check if this route is valid for the current subdomain ('*' means any subdomain is valid) | |||
if (Subdomains.Contains("*") || Subdomains.Contains(subdomain)) | |||
{ | |||
routeData.Values["sub"] = subdomain; | |||
return routeData; | |||
} | |||
} |
@@ -162,7 +162,7 @@ namespace Teknik.Areas.API.Controllers | |||
db.ShortenedUrls.Add(newUrl); | |||
db.SaveChanges(); | |||
string shortUrl = Url.SubRouteUrl(string.Empty, "Shortener.View", new { url = newUrl.ShortUrl }); | |||
string shortUrl = string.Format("http://{0}/{1}", Config.ShortenerConfig.ShortenerHost, newUrl.ShortUrl); | |||
if (Config.DevEnvironment) | |||
{ | |||
shortUrl = Url.SubRouteUrl("shortened", "Shortener.View", new { url = newUrl.ShortUrl }); |
@@ -56,7 +56,7 @@ namespace Teknik.Areas.Shortener.Controllers | |||
db.ShortenedUrls.Add(newUrl); | |||
db.SaveChanges(); | |||
string shortUrl = Url.SubRouteUrl(string.Empty, "Shortener.View", new { url = newUrl.ShortUrl }); | |||
string shortUrl = string.Format("http://{0}/{1}", Config.ShortenerConfig.ShortenerHost, newUrl.ShortUrl); | |||
if (Config.DevEnvironment) | |||
{ | |||
shortUrl = Url.SubRouteUrl("shortened", "Shortener.View", new { url = newUrl.ShortUrl }); |