From 021ecc506a1cce11d12daba847f047853de4ba42 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Mon, 23 Nov 2020 15:47:41 +0000 Subject: [PATCH] --- Controllers/QBridgeController.cs | 4 ---- Startup.cs | 23 ++++++++++++++++++----- notes.txt | 7 ++++++- qbridge.csproj | 16 +++++++++------- 4 files changed, 33 insertions(+), 17 deletions(-) diff --git a/Controllers/QBridgeController.cs b/Controllers/QBridgeController.cs index bad4af2..3c060e4 100644 --- a/Controllers/QBridgeController.cs +++ b/Controllers/QBridgeController.cs @@ -1,8 +1,4 @@ using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace qbridge.Controllers diff --git a/Startup.cs b/Startup.cs index 99897a7..147310e 100644 --- a/Startup.cs +++ b/Startup.cs @@ -1,8 +1,11 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + + + namespace qbridge { @@ -18,12 +21,13 @@ namespace qbridge // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { + services.AddControllers().AddNewtonsoftJson(); services.AddHttpClient(); - services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); + // services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IHostingEnvironment env) + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { @@ -31,12 +35,21 @@ namespace qbridge } else { - // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. + // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } + app.UseRouting(); + + // app.UseAuthorization(); + app.UseEndpoints(endpoints => + { + endpoints.MapControllers(); + + }); + app.UseHttpsRedirection(); - app.UseMvc(); + // app.UseMvc(); } } } diff --git a/notes.txt b/notes.txt index 093d3f1..67c00cd 100644 --- a/notes.txt +++ b/notes.txt @@ -21,13 +21,18 @@ DEPLOYMENT qboauth.ayanova.com publish command line from C:\data\code\qbridge folder: //this will build a release version which is what we use on the server now -dotnet publish -c Release -o ./../publish/ +//DEPRECATED dotnet publish -c Release -o ./../publish/ +//this will build for our ubunutu linux server +dotnet publish -c Release -o ./../publish/ --no-self-contained -r linux-x64 //if need a debug version dotnet publish -o ./../publish/ 3) COPY + +## MAKE BACKUP FIRST: cp -R pecklist pecklist_backup + Copy over to production server, only need the .dll and the wwwroot folder contents, remember not to delete the folders on the server only replace their contents because there are file permissions set Backup the database diff --git a/qbridge.csproj b/qbridge.csproj index ac340e9..b861e9d 100644 --- a/qbridge.csproj +++ b/qbridge.csproj @@ -1,13 +1,15 @@ - - netcoreapp2.2 - InProcess + net5.0 + + + + + - - - -