Skip to content

Instantly share code, notes, and snippets.

@mikekunze
Created February 15, 2012 03:05
Show Gist options
  • Save mikekunze/1832810 to your computer and use it in GitHub Desktop.
Save mikekunze/1832810 to your computer and use it in GitHub Desktop.
Creating a bang.js application
CoreApplication = require '../lib/CoreApplication.coffee'
class ExampleApplication extends CoreApplication
__appName: 'example'
__appVersion: 1.0
__appPath: __dirname
__controllers: [ '/example' ]
constructor: (cb) ->
super @, ()=> @loadControllers ()=>
@logger.logMessage '[Server][Example] - ExampleApplication is loaded'
cb()
@
loadControllers: (cb) ->
@app.get "/example", (req, res) =>
@settings.app = "example"
res.render "example", {
layout: "example.layout.jade"
title: "Example"
settings: @settings
}
cb()
module.exports = ExampleApplication
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment