<commit_before>require! <[ express http path passport fs multiparty ./sockets ]>
io = require('socket.io')

# Yale CAS
cas = require('grand_master_cas')
cas.configure({
  casHost: "secure.its.yale.edu",
  casPath: "/cas",
  service: "http://localhost:3000",
})

# Express config
app = express!
development = 'development' == app.get('env')
app.set('port', process.env.PORT || 3000)
app.use _
  .. if development then express.logger 'dev' else express.logger!
  .. express.compress!
  .. <| express.static <| path.join(__dirname, 'build')
  .. express.urlencoded!
  .. app.router
  .. express.errorHandler! if development
  .. express.cookieParser!

json = express.json!

# http responses
app.get '/', cas.bouncer, (req, res)!-> res.send 200

# socketio responses
server = http.createServer(app)
ioapp = io.listen(server)
sockets.startRedis(ioapp)
ioapp.sockets.on('connection', sockets.connect)

# start the server
server.listen(app.get('port'), ->
  console.log('Express server listening on port ' + app.get('port')))<commit_msg>CAS works now. using ssl<commit_after>require! <[ express http path multiparty ./sockets ]>
io = require('socket.io')

# Express config
app = express!
development = 'development' == app.get('env')
app.set('port', process.env.PORT || 3000)
app.use _
  .. if development then express.logger 'dev' else express.logger!
  .. express.compress!
  .. <| express.static <| path.join(__dirname, 'build')
  .. express.urlencoded!
  .. app.router
  .. express.errorHandler! if development

session =
  express.cookieParser!
  express.session(secret: process.env.SECRET)

# Yale CAS
cas = require('grand_master_cas')
cas.configure({
  casHost: "secure.its.yale.edu",
  casPath: "/cas",
  ssl: true,
  port: 443,
  service: process.env.SITE + ':' + app.get('port')
})

json = express.json!

# http responses
app.get '/', session, cas.bouncer, (req, res)!-> res.send 200

# socketio responses
server = http.createServer(app)
ioapp = io.listen(server)
sockets.startRedis(ioapp)
ioapp.sockets.on('connection', sockets.connect)

# start the server
server.listen(app.get('port'), ->
  console.log('Express server listening on port ' + app.get('port')))
{'fraction_non_alphanumeric': 0.16543438077634012, 'fraction_numerical': 0.009704251386321626, 'mean_word_length': 4.319410319410319, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6895787', 'n_tokens_mistral': 748, 'n_tokens_neox': 712, 'n_words': 166}