Skip to content

Instantly share code, notes, and snippets.

@marcosdeaguiar
Created May 20, 2020 18:32
Show Gist options
  • Save marcosdeaguiar/56043b7e3ead5c7b937fd2f6a2360b11 to your computer and use it in GitHub Desktop.
Save marcosdeaguiar/56043b7e3ead5c7b937fd2f6a2360b11 to your computer and use it in GitHub Desktop.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
// ... Other middlewares ...
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseSpaStaticFiles();
app.UseCookiePolicy();
app.UseJwtCookieMiddleware(app.ApplicationServices.GetService<IAntiforgery>(), Encoding.ASCII.GetBytes("signing key"));
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
});
app.UseAntiforgeryCookieMiddleware(app.ApplicationServices.GetService<IAntiforgery>());
app.UseSpa(spa =>
{
spa.Options.SourcePath = "ClientApp";
if (env.IsDevelopment())
{
//spa.UseReactDevelopmentServer(npmScript: "start");
spa.UseProxyToSpaDevelopmentServer("http://localhost:3000");
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment