mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 09:35:39 -05:00
9401a4370e
Conflicts: server.coffee server/db.coffee
27 lines
701 B
CoffeeScript
27 lines
701 B
CoffeeScript
do (setupLodash = this) ->
|
|
GLOBAL._ = require 'lodash'
|
|
_.str = require 'underscore.string'
|
|
_.mixin _.str.exports()
|
|
|
|
express = require 'express'
|
|
http = require 'http'
|
|
winston = require 'winston'
|
|
serverSetup = require './server_setup'
|
|
|
|
module.exports.startServer = ->
|
|
app = createAndConfigureApp()
|
|
http.createServer(app).listen(app.get('port'))
|
|
winston.info("Express SSL server listening on port " + app.get('port'))
|
|
return app
|
|
|
|
createAndConfigureApp = ->
|
|
serverSetup.setupLogging()
|
|
serverSetup.connectToDatabase()
|
|
serverSetup.setupMailchimp()
|
|
|
|
app = express()
|
|
serverSetup.setExpressConfigurationOptions app
|
|
serverSetup.setupMiddleware app
|
|
serverSetup.setupRoutes app
|
|
app
|
|
|