Giter Site home page Giter Site logo

Server-Side Data about nuxt.js HOT 7 CLOSED

nuxt avatar nuxt commented on April 28, 2024 1
Server-Side Data

from nuxt.js.

Comments (7)

Atinux avatar Atinux commented on April 28, 2024

Hi @knpwrs

Actually, Nuxt.js already render a page that can work without the JS on the client-side (because it's server-renderer).

For connecting to a server-side database, I would not recommend it because when navigating in the client-side, your page will have to render the data as well and since you want to protect it for only the server-side, it won't work.

Nuxt.js is made to create web-application based on API so the API call (http request from the server-side or ajax request on the client-side) will work for both environments.

from nuxt.js.

knpwrs avatar knpwrs commented on April 28, 2024

Unfortunately the API call won't work for a client without JavaScript which kinda makes server-side rendering moot except for the point of getting a fast initial render.

from nuxt.js.

Atinux avatar Atinux commented on April 28, 2024

@knpwrs if the client does not have JavaScript, it will reload the page, and you can use axios to make API call from the server-side as well.

from nuxt.js.

Mirodil avatar Mirodil commented on April 28, 2024

Is it possible load data to nuxt.js without creating additional http request from server-side, and send rendered html page to client?

from nuxt.js.

Atinux avatar Atinux commented on April 28, 2024

@Mirodil please take a look at this answer I wrote: #123 (comment)

from nuxt.js.

Mirodil avatar Mirodil commented on April 28, 2024

Thanks, from client side it works and looks perfect, but server side part bit odd.

from nuxt.js.

lock avatar lock commented on April 28, 2024

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.

from nuxt.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.