Created
June 5, 2012 09:34
-
-
Save vojto/2873895 to your computer and use it in GitHub Desktop.
Dog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # __ | |
| # ()'`; | |
| # /\|` | |
| # / | | |
| # (/_)_|_ | |
| # | |
| 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