Re:Missing the Point of Server-side Rendered JavaScript Apps
by gweinberg on Thursday February 05, 2015 @02:17PM
(#9005238)
Well, I freely concede I am still missing the point. You use client-side javascript because that's what runs in the client. Whatever your server-side code does, why would you write it in javascript?
[ Parent
| on HN ]
Re:Missing the Point of Server-side Rendered JavaScript Apps
by sanderjd on Thursday February 05, 2015 @04:07PM
(#9006103)
Here is an architecture that fits what the article is talking about:
--------------------------
| In-browser EmberJS app |------
-------------------------- |
| |
HTML (1) |
| |
------------------------------- |
| Same EmberJS app, running on| |
| server, generating HTML | |
------------------------------- |
| ----------
JSON (2) JSON (3)
| |
------------------------------------
|JSON API server written in, eg. Go|
------------------------------------
You don't write any more javascript than you already would have for the client app, and you can write your API server however you want.
Re:Missing the Point of Server-side Rendered JavaScript Apps
by smacktoward on Thursday February 05, 2015 @03:15PM
(#9005691)
Because writing an app in one language is easier than writing it in two or more, and since JavaScript is the only language you can do client-side scripting in you're probably going to be writing some JavaScript no matter what. So if you want the ease of writing your whole app in one language, the only language that one language can possibly be is JavaScript.
Re:Missing the Point of Server-side Rendered JavaScript Apps
by scribu on Thursday February 05, 2015 @02:54PM
(#9005537)
As the post mentions, the node.js app that servers the initial HTML would be separate from the API server. The code in the API server can, as before, be implemented in whatever language you want.