SPA Api Middleware
October 23, 2020

This middleware will preserve the SPA (Single Page Application) navigation and functionality when the deep link of any page is sent via email or other communication tools. It will also preserve it when the page is refreshed in the browser.
Requirements
SPA files served from wwwroot folder of a .Net Core 2+ Api project.
Install
> dotnet add package SpaApiMiddleware --version 1.0.1
Nuget link
The package is available on nuget: https://www.nuget.org/packages/SpaApiMiddleware
Usage
In your .net core 2.0 Startup.cs class add :
using SpaApiMiddleware;
and then in Configure method add:
app.UseSpaApiOnly();
or with custom settings:
app.UseSpaApiOnly(indexHtmlPage:"index.html", apiPath:"api");
Both apiPath and indexHtmlPage are optional parameters.
Happy coding!
@imhotepp