diff --git a/Controllers/InstructorsDataController.cs b/Controllers/InstructorsDataController.cs index a2ec1c2..4620a27 100644 --- a/Controllers/InstructorsDataController.cs +++ b/Controllers/InstructorsDataController.cs @@ -1,13 +1,13 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using InstructorsListApp.Models; namespace InstructorsListApp.Controllers { [Route("api/v1/instructors")] + [ApiController] public class InstructorsDataController : Controller { DatabaseContext databaseContext; diff --git a/Startup.cs b/Startup.cs index 0dd1413..e4b5557 100644 --- a/Startup.cs +++ b/Startup.cs @@ -27,12 +27,13 @@ namespace InstructorsListApp .ConfigurationExtensions .GetConnectionString(this.Configuration, "DefaultDatabase"); services.AddDbContext(options => options.UseSqlServer(conString)); - //services. // In production, the Angular files will be served from this directory services.AddSpaStaticFiles(configuration => { configuration.RootPath = "ClientApp/dist"; }); + + } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. @@ -49,7 +50,14 @@ namespace InstructorsListApp app.UseHsts(); } - app.UseHttpsRedirection(); + app.UseMvc(routes => + { + routes.MapRoute( + name: "default", + template: "{controller=Home}/{action=Index}/{id?}"); + }); + + //app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseSpaStaticFiles();