-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
472ad86
commit 1a7cc5c
Showing
1 changed file
with
67 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,69 @@ | ||
# AspSpaService | ||
The Asp Net Core plugin for integrating SPA application with Asp Net Core. | ||
This plugin can be used with any web framework in same manner. | ||
This plugin can be used with any web framework in same manner. | ||
|
||
# Usage | ||
Change your Startup.cs configuration file as follows: | ||
```cs | ||
using AspSpaService; | ||
public class Startup | ||
{ | ||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) | ||
{ | ||
// ---- Your code -----------// | ||
//this block starts vue spa application | ||
var p = Path.Combine(wd,"samples", "hello-vue"); // path to your vuejs project | ||
app.UseSpa( | ||
spa => { | ||
spa.UseAspSpaDevelopmentServer("yarn", "serve", p, new Dictionary<string,string>(), TimeSpan.FromSeconds(15), null); | ||
} | ||
); | ||
} | ||
} | ||
|
||
``` | ||
|
||
## Sample configuratons | ||
In folder sample/webapi has the web empty project that shows, how to use your favorite web framework with asp: | ||
### Vue | ||
```cs | ||
public class Startup | ||
{ | ||
//this block starts vue spa application | ||
var p = Path.Combine(wd,"samples", "hello-vue"); // path to your vuejs project | ||
app.UseSpa( | ||
spa => { | ||
spa.UseAspSpaDevelopmentServer("yarn", "serve", p, new Dictionary<string,string>(), TimeSpan.FromSeconds(15), null); | ||
} | ||
); | ||
} | ||
|
||
``` | ||
### Vite | ||
```cs | ||
public class Startup | ||
{ | ||
//this block starts vite spa application | ||
var p = Path.Combine(wd,"samples", "hello-vite"); // path to your vitejs project | ||
app.UseSpa( | ||
spa => { | ||
spa.UseAspSpaDevelopmentServer("yarn", "dev", p, new Dictionary<string,string>(), TimeSpan.FromSeconds(15), null); | ||
} | ||
); | ||
} | ||
|
||
``` | ||
### Nuxt | ||
```cs | ||
public class Startup | ||
{ | ||
//this block starts nuxt spa application | ||
var p = Path.Combine(wd,"samples", "hello-nuxt"); // path to your nuxt project | ||
app.UseSpa( | ||
spa => { | ||
spa.UseAspSpaDevelopmentServer("yarn", "dev", p, new Dictionary<string,string>(), TimeSpan.FromSeconds(15), null); | ||
} | ||
); | ||
} | ||
|
||
``` |