saymedia / angularjs-server

Specialized server for AngularJS sites
MIT License
248 stars 49 forks source link

Expose a method to run an arbitrary function in our Angular context. #5

Closed apparentlymart closed 10 years ago

apparentlymart commented 10 years ago

This is intended to allow callers to use the context to do things other than serve requests. For example, a caller could use this during startup to inspect something in the application and pre-generate certain responses, or conditionally register middlewares in Express, or other such tasks.

This then becomes a building block for the existing middlewareWithAngular function, that provides the same capability for the common case where it's a middleware that needs the context.