Skip to content

Commit

Permalink
Merge pull request #581 from ffMathy/NS-580
Browse files Browse the repository at this point in the history
#580: Migrated site to new host
  • Loading branch information
ffMathy authored Sep 22, 2018
2 parents a44c6ef + c4bc70d commit 9f43774
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 18 deletions.
32 changes: 17 additions & 15 deletions src/Shapeshifter.Website/Program.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
using System.IO;

using System.Net;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;

namespace Shapeshifter.Website
{
public class Program
{
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
.UseApplicationInsights()
.Build();
public class Program
{
public static void Main(string[] args)
{
CreateWebHostBuilder(args).Build().Run();
}

host.Run();
}
}
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseKestrel(opt =>
{
opt.Listen(IPAddress.Loopback, 5002);
});
}
}
11 changes: 10 additions & 1 deletion src/Shapeshifter.Website/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
namespace Shapeshifter.Website
{
using Logic;
using Microsoft.AspNetCore.HttpOverrides;

public class Startup
{
Expand Down Expand Up @@ -37,11 +38,19 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
.AllowAnyMethod()
.AllowAnyOrigin());

app.UseHttpsRedirection();
app.UseDefaultFiles();
app.UseStaticFiles();

// Listen for forwarded headers from Nginx
app.UseForwardedHeaders(new ForwardedHeadersOptions
{
ForwardedHeaders = ForwardedHeaders.All
});

app.UseMvc(
routes => {
routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
Expand Down
2 changes: 1 addition & 1 deletion src/Shapeshifter.Website/wwwroot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ <h2>Support me</h2>
<div class="d-flex flex-column pl-2 pr-2">
<div class="card-group shadow-sm">
<div class="card">
<img alt="Mathias Lorenzen profile picture" class="profile-picture" src="https://media.licdn.com/dms/image/C5603AQEyE-vaAwZD2g/profile-displayphoto-shrink_200_200/0?e=1531958400&v=beta&t=qIipVoEqTklqt8xzOZAVUoocrj_LDSmTh26JQ0Ub3l4">
<img alt="Mathias Lorenzen profile picture" class="profile-picture" src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/4197032/6d5020b616ac49b28f5f01e17e900b05/2?token-time=2145916800&token-hash=eyOcij2NmMgJe8tJEWIs_8DYKdcD6UHiI9RQM9aX3AI%3D">
<div class="card-body">
<h5 class="card-title">About me</h5>
<p class="card-text">My name is Mathias Lorenzen and I'm a geek with a passion for all creating and perfecting software. While Shapeshifter is free for you to use, showing your support helps me keep the project alive.</p>
Expand Down
2 changes: 1 addition & 1 deletion src/Shapeshifter.Website/wwwroot/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $.getJSON("https://api.github.com/repos/ffMathy/Shapeshifter/releases/latest").d
$("#download-version").text(version);
});

$.getJSON("https://shapeshifter.azurewebsites.net/api/patreon/supporters").done(function (json) {
$.getJSON("/api/patreon/supporters").done(function (json) {
var goal = 100;

var supporters = json.sort((a, b) => b.amount - a.amount);
Expand Down

0 comments on commit 9f43774

Please sign in to comment.