SPA Api Middleware

https://github.com/imhotepper/SpaApiMiddleware


This middleware will preserve the SPA 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 served from wwwroot folder of a .Net Core 2 Api project.

Install

> dotnet add package SpaApiMiddleware --version 1.0.1

Nuget link

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.

Author

Dragos Stefanescu (Twitter/GitHub).

License

MIT License