Skip to content

Instantly share code, notes, and snippets.

@shimaore
Created January 6, 2011 14:08
Show Gist options
  • Save shimaore/767922 to your computer and use it in GitHub Desktop.
Save shimaore/767922 to your computer and use it in GitHub Desktop.
class Zappa
constructor: ->
...
@locals =
app: (name,server) => @app name,server
...
app: (name,server) ->
@ensure_app name,server
@current_app = @apps[name]
...
ensure_app: (name,server) ->
@apps[name] = new App(name,server) unless @apps[name]?
@current_app = @apps[name] unless @current_app?
class App
constructor: (@name,configure) ->
...
@http_server.configure =>
if configure?
configure @http_server
else
... /* default */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment