Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.

Commit 6f24808

Browse files
committed
Add usage example and package title.
1 parent 159fcab commit 6f24808

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

README.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,43 @@
11
This is a stand-alone module to add VueCli support to Aspnet Core 2.1.
22

33
Due to the discussion here, it was decided to not be included in the Microsoft owned package.
4-
https://github.com/aspnet/JavaScriptServices/pull/1726
4+
https://github.com/aspnet/JavaScriptServices/pull/1726
5+
6+
Usage Example:
7+
```csharp
8+
public class Startup
9+
{
10+
public Startup(IConfiguration configuration)
11+
{
12+
Configuration = configuration;
13+
}
14+
15+
public IConfiguration Configuration { get; }
16+
17+
public virtual void ConfigureServices(IServiceCollection services)
18+
{
19+
services.AddMvc(); // etc
20+
}
21+
22+
public virtual void Configure(IApplicationBuilder app, IHostingEnvironment env)
23+
{
24+
// your config opts...
25+
26+
// add static files from SPA (/dist)
27+
app.UseSpaStaticFiles();
28+
29+
app.UseMvc(routes => /* configure*/ );
30+
31+
app.UseSpa(spa =>
32+
{
33+
spa.Options.SourcePath = "ClientApp";
34+
#if DEBUG
35+
if (env.IsDevelopment())
36+
{
37+
spa.UseVueCli(npmScript: "serve", port: 8080); // optional port
38+
}
39+
#endif
40+
});
41+
}
42+
}
43+
```

src/VueCliMiddleware.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<PropertyGroup>
44
<Description>Helpers for building single-page applications on ASP.NET MVC Core using Vue Cli.</Description>
55
<TargetFramework>netstandard2.0</TargetFramework>
6+
<Title>VueCliMiddleware</Title>
67
<VersionPrefix>2.1.1</VersionPrefix>
78
<LangVersion>Latest</LangVersion>
89
<Authors>EEParker</Authors>

0 commit comments

Comments
 (0)