Skip to content

Instantly share code, notes, and snippets.

View rishiraj824's full-sized avatar
🏠
Working from home

Rishi Raj rishiraj824

🏠
Working from home
View GitHub Profile
@rishiraj824
rishiraj824 / GSoC2017_FOSSASIA_Rishi_Raj.md
Last active August 9, 2021 11:57
Google Summer of Code 2017 - Rishi Raj - Contributions - FOSSASIA
@rishiraj824
rishiraj824 / ssr-guide.md
Last active January 19, 2020 21:17
Going about SSR in a CRA app.

Ideally the server should only be serving static files and to do that your express app should use some simple templating engine. This combined with a default loader in your HTML file should take care of the overall loading.

I have attached a prefetcher module below, a middleware, whose main purpose is to fetch the data required to render a route.

Important Steps

  1. You can have an index.marko or an index.html which will be your skeleton file. I have demonstrated it using marko.js, you can use any other templating engine.