Skip to content

cloudmark/Spa.Extensions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SPA Extensions

This is an SPA middleware which serve index.html if other middleware do not satisfy the request.
In single page applications it is common that the client handles routes instead of the MVC controllers.

Usage

To use the middleware add it to the configuration section.

public void Configure(IApplicationBuilder app)
{

    // Add static files
    app.UseStaticFiles();

    // Add MVC
    app.UseMvc();

    // Add SPA
    app.UseSpa(); 

}

To change the default behaviour initialise as follows:

app.UseSpa(new SpaOptions() {
	DefaultHtml =  new PathString("/index.html"), 
	DebugMode = true // If the index.html is changing make sure to set the flag to Debug.  
}); 

About

Single Page Application Extensions for AspvNext

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages