Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Stoph
Mar 19, 2006

Give a hug - save a life.
Node.js is nice because it gave front-end web development a decent package manager to rule them all. Not sure if I'm much of a fan of it for API endpoints though... getting proper stack traces from Node.js exceptions is not very easy.

Node.js fits better as a proxy/middle-tier if you really want to use it on the server, backed by an API written in something else.

Stoph fucked around with this message at 01:15 on Feb 26, 2015

Adbot
ADBOT LOVES YOU

Stoph
Mar 19, 2006

Give a hug - save a life.

Maluco Marinero posted:

Right now a front end designer and I are building a site with a node server as the template renderer. He's building the lot through standard front end build tools, all static builds in Jade but with template data supplied by JSON files. Meanwhile, I'm building the server stuff on Django because its suitable for this project.

When it comes time to port the static builds over to the dynamic website, were just going to run a little node server that accepts PUTs with a JSON body, and returns the requested template rendered with that data. Theory is the template rendering stays with the same tech throughout the entire project (rather than say a buggy implementation of pyJade, ), we can prerender React, yet still avoid having to deal with Node actually talking to the end user.

In addition each template render should be cacheable, what with the only element changing being the incoming template JSON.

Mainly, we avoid having to use Node for all the server poo poo that its bad/immature at, whilst taking advantage of all the front end tooling written in JS these days.

Might crash in a flaming heap, but feels pretty reasonable as a concept.

This is pretty much exactly what I advocated in my post earlier, except you're actually doing it. It's like a more specialized and thus more efficient version of https://prerender.io/

Stoph
Mar 19, 2006

Give a hug - save a life.
The biggest issue with Node APIs for me was the miserable stack traces but I'm hoping generators or async/await could fix that? It's been a while since I worked on a production Node app...

Stoph
Mar 19, 2006

Give a hug - save a life.
Generators are native in all npm compatible runtimes. Async is not. I like that generators preserve the stack trace really nice if your application uses them pervasively...

Stoph
Mar 19, 2006

Give a hug - save a life.
The error handling really is poo poo in Node.js.

Clojure seems like a better full stack language if that's the reason you're picking Node.js. Anyone tried that?

  • Locked thread