mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-23 01:58:29 +00:00
Initial state
This commit is contained in:
27
samples/angular/MusicStore/Controllers/HomeController.cs
Executable file
27
samples/angular/MusicStore/Controllers/HomeController.cs
Executable file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Http;
|
||||
using Microsoft.AspNet.Mvc;
|
||||
|
||||
namespace MusicStore.Controllers
|
||||
{
|
||||
public class HomeController : Controller
|
||||
{
|
||||
public IActionResult Index()
|
||||
{
|
||||
var url = Request.Path.Value;
|
||||
if (url.EndsWith(".ico") || url.EndsWith(".map")) {
|
||||
return new HttpStatusCodeResult(404);
|
||||
} else {
|
||||
return View();
|
||||
}
|
||||
}
|
||||
|
||||
public IActionResult Error()
|
||||
{
|
||||
return View("~/Views/Shared/Error.cshtml");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user