Removed frontend and moved out of sln into solely csproj style

This commit is contained in:
2018-03-06 16:22:21 -05:00
parent dc1937d2f8
commit a3e7b4f8f7
42 changed files with 1 additions and 11792 deletions

47
Startup.cs Normal file
View File

@ -0,0 +1,47 @@
using System;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Hangfire;
using Hangfire.PostgreSql;
using Microsoft.EntityFrameworkCore;
namespace YTManager {
public class Startup {
public Startup(IConfiguration configuration) {
Configuration = configuration;
}
public IConfiguration Configuration { get; }
public static string DBStr {
get {
string s = Environment.GetEnvironmentVariable("POSTGRESQL_DBSTR");
s = s ?? "Server=localhost;Port=32768;Database=postgres;User Id=postgres;";
return s;
}
}
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services) {
Console.WriteLine("Using db string of: " + DBStr);
services.AddMvc();
services.AddDbContext<MediaDB>(x => x.UseNpgsql(DBStr));
services.AddHangfire(x => x.UsePostgreSqlStorage(DBStr));
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env) {
if (env.IsDevelopment())
app.UseDeveloperExceptionPage();
app.UseDefaultFiles();
app.UseStaticFiles();
app.UseCors(b => { b.AllowAnyOrigin(); b.AllowAnyMethod(); });
app.UseMvc();
app.UseHangfireServer();
app.UseHangfireDashboard();
}
}
}