Skip to content

Instantly share code, notes, and snippets.

@vojto
Created June 5, 2012 09:34
Show Gist options
  • Select an option

  • Save vojto/2873895 to your computer and use it in GitHub Desktop.

Select an option

Save vojto/2873895 to your computer and use it in GitHub Desktop.
Dog
# __
# ()'`;
# /\|`
# / |
# (/_)_|_
#
class Server
# -^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-
# Lifecycle
# ---------------------------------------------------------------------------
constructor: ->
server = new Mongolian
@_database = server.db('impensi_dev')
@_http = Express.createServer()
@_http.use(Express.static(__dirname + '/../public'))
@_http.use(Express.bodyParser())
# Services -- only users in this case
@_users = new Users(@)
@_http.get '/login', @login
@_http.post '/sign_up', @sign_up
# Modules
@resources = new Resources(@)
start: ->
@_http.listen(4001)
log 'Starting HTTP server on port 3001.'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment