Fork me on GitHub
#reagent
<
2015-08-18
>
Pablo Fernandez19:08:46

Is this the best way to pre-render reagent on the server: https://github.com/savaki/reagent-nodejs ?

gadfly36119:08:34

Yeah, I think so. (I believe Matt Ho also has an updated version too, but hasnt pushed it to github yet.)

Pablo Fernandez19:08:01

Why not using PhatomJS directly, like for testing?

henry19:08:38

I believe express is more flexible and natural to use, you can handle routes etc.

Pablo Fernandez19:08:27

express? What is express?

henry19:08:07

Have you pulled down the repo and ran the "quick start"

Pablo Fernandez19:08:52

henryzhu: nope. I don’t understand why nodejs is used in these cases, or how actually.

henry19:08:10

Essentially we need a JavaScript runtime on our server (in this case we use nodeJS) to run the JS that Reagent/CLJS generates. After the JS it’s fully rendered to HTML in Node, we serve the HTML to our browser via Express routing.

henry19:08:26

And basically you get an app like this: http://reagent-nodejs.herokuapp.com/ fully SEO crawlable web app with a fast initial page load.