DEV Community

Discussion on: SPAs are way too much work

Collapse
 
bizzycola profile image
Bizzycola

Would you have a separate serverside project that consumes the API or just abstract it in such a way that the SSR and the API endpoints call the same services in your code?

Usually, when I think of SSR I think of templating (An example is my personal site, written with ASP.net Core and Razor templating. No API's are present there and the front-end is part of the back-end code in that it uses ASP's templating engine).

Just curious how you would usually go about it!

Thread Thread
 
powerc9000 profile image
Clay Murray • Edited

So what we currently do is yeah if I want to get all the documents I have a model for the documents API uses at GET /documents/{id} uses and the view uses.

The views are ejs templates. The frontend is part of the backend code but the way its set up it's in its own folder and has its own build process with parceljs.

So it's a big ol monorepo basically.