Hi all,

I just wanted to share a project we've been working on at Say Media to 
provide a relatively-lightweight (relative to running PhantomJS, etc) 
mechanism to run our application on the server, with the goal of providing 
statically-rendered pages to robots, but also allowing us to re-use our 
AngularJS modules when generating RSS feeds and XML sitemaps.

The project is here:
    https://github.com/saymedia/angularjs-server

The methodology is to provide replacement implementations for a number of 
core AngularJS services, adapting these interfaces to work in a 
NodeJS/Express server and providing these replacements via dependency 
injection. For example, $http is replaced with an implementation that uses 
node's http library, and $route is extended with additional functionality 
to allow routes to be resolved on the server side.

This solution is definitely not a magic bullet -- some of the limitations 
are spelled out in the README -- but if you're willing to stick to some 
slightly more restrictive development practices than you'd use targeting 
only the browser (e.g. primarily using the AngularJS API and not directly 
using browser APIs) then we've found this a compelling way to run our 
AngularJS application on our servers with less overhead and more 
flexibility than our previous PhantomJS-based rendering solution.

We're using this library in production as part of the server that powers 
many of Say Media's content sites like ReadWrite <http://readwrite.com/>, 
though we expect the design to evolve a little before it's 
finalized/stable. If others are interested in giving it a try I'd love to 
hear about your experiences and ideas you have about how it could be 
improved to be more generally-useful.

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to