Is Xano only for SPAs?

Options
Hello!

From my understanding, with the way Xano is setup (a backend that exposes data to the frontend with APIs and JSON), this seems purpose-built for SPA (Single Page Application) apps.

I was wondering if there are any use cases (or possibilities) of using Xano for an app that uses Server Side Rendering (SSR)? Would appreciate any insight.

Thanks!

Comments

  • Sean Montgomery
    Sean Montgomery Administrator

    ADMIN

    Options
    Hi ,

    Anything that can make an API request can utilize Xano. So you could have data from Xano inline within a wordpress site. The wordpress page would call the Xano API in their PHP code and then embed the data within the HTML.

    This tends to be a bit more advanced but still 100% doable. Normally developers just call the API in the frontend, so in the wordpress example the html page would use javascript to request the data and then dynamically embed it - but not needed if you know how to do it server side.

    The PHP layer is already requesting data from the database, so it would be the same concept when requesting data from Xano.
  • Justin C
    Justin C Member
    Options
     gotcha! Thanks for the clarification, that makes sense.

    My use case is using Ruby On Rails to develop an app with Server Side Rendering. To use Xano according to your comment, I would call the Xano API in the Rails backend, grab & embed that data into the template, and then throw that .erb view to the front-end. I do wonder if this is an ideal route to go due to adding complexity, but just something I'm considering.

    Thanks again for the info
  • Sean Montgomery
    Sean Montgomery Administrator

    ADMIN

    Options
     another thing to consider is to use a framework like Angular for the frontend. It is a single page application, but has support for server side rendering.

    Our brochure site www.xano.com is a single page web application but deployed using server side rendering. If you notice, when you browse around the site, it is lightening fast. If you view the source code, you will see each page has unique source code.

    It is the best of both worlds. At the end of the day you should use whatever you are most comfortable with. There are a lot of options available and many ways to solve a problem.
  • Justin C
    Justin C Member
    Options
     This info is very helpful - thanks again!