I have a client side JS library(call it lib.js) which uses jQuery. The library fires an API using ajax and renders html based on the json response received.
Due to SEO concerns, I want to create another nodejs based API, which does all the client side work that lib.js does and creates html on the server side and responds with this html. The catch is that I want to use the same client side library(lib.js) on the server side too so that any changes made to lib.js affects the html response of my backend API too.
So, basically I am looking to execute client side JS on the server without doing too many changes to client side JS library.
I went through node modules of jquery and jsdom but could not find a conclusive way to approach this solution. Are there any better node modules to do this ? Is there any good article that targets this problem ?