mirror of
https://github.com/ChronosX88/InstructorsListAppTA.git
synced 2024-12-04 22:52:19 +00:00
[backend] fix: Fix route handling
This commit is contained in:
parent
c9de99b9db
commit
ee3071ab16
@ -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;
|
||||
|
12
Startup.cs
12
Startup.cs
@ -27,12 +27,13 @@ namespace InstructorsListApp
|
||||
.ConfigurationExtensions
|
||||
.GetConnectionString(this.Configuration, "DefaultDatabase");
|
||||
services.AddDbContext<DatabaseContext>(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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user