skyrpex / laravel-nuxt-js

Build a SPA with Laravel and Nuxt.
https://www.npmjs.com/package/laravel-nuxt
MIT License
146 stars 20 forks source link

Can this do Server-side-rendering or SSR for SEO? #23

Closed connecteev closed 4 years ago

connecteev commented 4 years ago

@skyrpex Thanks for this repo. I know this was asked over a year ago(#2), but can this run in SSR mode now?

I found your repo from your article here: https://dev.to/skyrpex/create-a-spa-with-laravel-and-nuxt--54k

Background: Like a lot of devs, I am building a complex, dynamic site in Laravel with lots of features. I am interested in making my Laravel app quick to render (client-side), and SEO is an important consideration because I need to be indexed well on Google. So, SSR becomes a necessity.

Tools like Nuxt.js exist for this reason. Can this repo / tool now do SSR?

skyrpex commented 4 years ago

@skyrpex Thanks for this repo.

You're welcome :)

I know this was asked over a year ago(#2), but can this run in SSR mode now?

Nope, I don't think there's a way to do that without using Nuxt's server along with the Laravel API. You could totally use Nuxt's server with SSR and call the Laravel API from it, but you'd need to wire everything yourself.

connecteev commented 4 years ago

@skyrpex thanks...but there is a way to do it, thats why I asked :) It's just not very elegant See https://github.com/spatie/laravel-server-side-rendering-examples and https://github.com/spatie/laravel-server-side-rendering