Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
kolesnikovav committed Jul 12, 2020
1 parent 472ad86 commit 1a7cc5c
Showing 1 changed file with 67 additions and 1 deletion.
68 changes: 67 additions & 1 deletion README.md
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);
}
);
}

```

0 comments on commit 1a7cc5c

Please sign in to comment.