Search code examples
javascriptrestnuxt.jsnext.jsserver-rendering

Javascript server-render libraries with non-JS REST APIs


Are server-rendered frameworks/libraries (such as Nextjs for React, Nuxt for Vue) and non-JS REST API backends (i.e. Java, Django, Go etc.) mutually exclusive or can they be used alongside?

Specifically, I am using Go for building a REST API at the backend and I wonder if I have to give it up for having the pages server-rendered.


Solution

  • These are two different concerns, really: Vue and React are JavaScript frameworks. They wouldn't run on your Go-based server application.

    There's nothing to stop you from rendering HTML in a Go application, but a Go server is not going to run a JavaScript framework. If it did, it would likely require extra scaffolding, and at that point you might as well set up a NodeJS server to handle rendering those routes.