Is there anyway to integrate Nuxt with asp.net core? I'm able to get Vue.js to work using the AspNetCore.SpaServices and adding "app.UseDefaultFiles();" to the pipeline to serve up a static html file and have vue-router take it from there. Looking at nuxt there's no static index.html so I'm getting a 404 of course. Any advise will be greatly appreciated. TIA.
Hi @roboriaan
Nuxt.js is for server-rendered application using its own node.js server, sadly it cannot be linked to ASP.net.
Bit of a necro-comment, but @roboriaan and anyone looking at these technologies - just wanted to point out I have had great success with Vue + Nuxt.js for handling UI, combined with Asp.Net Core WebApi for data and everything else.
_I looked at trying to use .Net Core JavascriptServices as the platform to work with Vue (and before that, React), but in my humble opinion you can architect far more flexible and high performance solutions, by keeping web-based UIs where they belong - in the fast moving JavaScript / Node / WebPack etc ecosystem, with business logic, patterns such as CQRS/ES, large scale integration, workflow etc, handled in the mature and capable .Net world._
Here is an example of how well these can work together, in this case, Vue + Nuxt.js working with ServiceStack (.Net Core) :
Awesome @mcquiggd :)
@mcquiggd Would this also be possible using standard .Net Core Identity? Planning to upgrade my old MVC ASP.NET Membership site to a Nuxt.js frontend and .Net Core Identity backend.
@acidduck
Technically I can see no reason why it should not.
Essentially everything is a standard, e.g. Oauth, OpenID, token, so, in theory you could use Identity Server with any stack.
Indeed a quick Google reveals npm packages for Express (which you can choose to use with Nuxt), to work with Identity Server 3.
https://www.npmjs.com/package/passport-identityserver3
https://www.npmjs.com/package/passport-idsrv3
Plus I would check the quickstarts.
If I have ever have time I`ll try to spin up a Container with Identity Server 4 and knock something up.
Personally I have been using Firebase, sometimes just for authentication. Cheapest solution available... 100,000 simultaneous authenticated users for $25 a month, or less.
@mcquiggd
Thanks, but I was actually thinking about just using the integrated Identity solution for .net core
https://docs.microsoft.com/en-us/aspnet/core/security/authentication/identity
I鈥檓 just not sure how to combine it with Nuxt.js?
@acidduck
Ok. Well, again, you are basically talking about a standards based token provider (in this case a couple of endpoints on the API, with the rest being attributed with Authorize
) There are a number of articles online about issuing tokens from a WebAPI that call ASP.Net Core Identity behind the scenes.
Now, that would cover an SPA fairly simply. You could store the token in local storage, and pass it with each axios call to the WebAPI.
If you want to use SSR, take a look at these threads for starters, regarding the use of a cookie to send the authorisation token to the server, and an example using the ubiquitous (for that, read aggressively marketed
) and horrendously expensive Auth0, which you can swap out for another STS.
https://github.com/nuxt/nuxt.js/issues/575
https://github.com/nuxt/nuxt.js/issues/2124
and the official Auth module
https://github.com/nuxt-community/auth-module
Personally I prefer to keep my STS outside my app - not only is that a better separation of concerns, it also allows SSO scenarios. Identity Server 4 is built by industry experts, and they are constantly refining it and updating it - Microsoft also recommends it. I tend to containerise it and use a database as a service from whichever cloud provider I am using. But, as I say, Firebase does what Auth0 etc do, but for cheap.
I think you need to separate your client app (nuxt and node) and web api with .net core. Publish you node server then call .net web api... If you combine with .net web api and nuxt with same project You can face with some unknown situation even this project work in start point, you cannot guess what will be happen in the feature.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Bit of a necro-comment, but @roboriaan and anyone looking at these technologies - just wanted to point out I have had great success with Vue + Nuxt.js for handling UI, combined with Asp.Net Core WebApi for data and everything else.
_I looked at trying to use .Net Core JavascriptServices as the platform to work with Vue (and before that, React), but in my humble opinion you can architect far more flexible and high performance solutions, by keeping web-based UIs where they belong - in the fast moving JavaScript / Node / WebPack etc ecosystem, with business logic, patterns such as CQRS/ES, large scale integration, workflow etc, handled in the mature and capable .Net world._
Here is an example of how well these can work together, in this case, Vue + Nuxt.js working with ServiceStack (.Net Core) :
https://github.com/mattjcowan/servicestack-nuxt-example