<commit_before>express = require "express"
Auth    = require "./app/auth"
User    = require "./app/storage"
Q       = require "q"
Mail    = require "./app/mail"

port = process.env.PORT || 5000

app = express()

# Serve up static files in the public folder
app.configure ->
  app.use express.static(__dirname + '/public')
  app.use express.bodyParser()

  # Allow CORS
  app.all "/*", (req, res, next) ->
    res.header "Access-Control-Allow-Origin", "*"
    res.header "Access-Control-Allow-Headers", "X-Requested-With"
    next()

# DebugMode
DebugMode = on
app.__debug = ->
  DebugMode = on

# GET and POST requests
api =
  "v0":


    # ------------
    # Registration
    # ------------

    "post_register": (req, res) ->
      user =
        name: req.body.name
        email: req.body.email
        password: <PASSWORD>
      Auth.register(user.name, user.email, user.password)
        .then (token) ->
          res.send token
        .fail (err) ->
          res.status(400).send err

    "get_register/*": (req, res) ->
      token = req.params[0]<commit_msg>Debug mode is now enabled by passing --debug as an argument<commit_after>express = require "express"
Auth    = require "./app/auth"
User    = require "./app/storage"
Q       = require "q"
Mail    = require "./app/mail"

port = process.env.PORT || 5000

app = express()

# Serve up static files in the public folder
app.configure ->
  app.use express.static(__dirname + '/public')
  app.use express.bodyParser()

  # Allow CORS
  app.all "/*", (req, res, next) ->
    res.header "Access-Control-Allow-Origin", "*"
    res.header "Access-Control-Allow-Headers", "X-Requested-With"
    next()

# DebugMode
DebugMode = off
app.__debug = ->
  console.warn "\u001b[31mRunning in debug mode!\u001b[0m"
  DebugMode = on
# Enable debug mode if passed as argument
if "--debug" in process.argv then app.__debug()

# GET and POST requests
api =
  "v0":


    # ------------
    # Registration
    # ------------

    "post_register": (req, res) ->
      user =
        name: req.body.name
        email: req.body.email
        password: <PASSWORD>
      Auth.register(user.name, user.email, user.password)
        .then (token) ->
          res.send token
        .fail (err) ->
          res.status(400).send err

    "get_register/*": (req, res) ->
      token = req.params[0]
{'fraction_non_alphanumeric': 0.16309931506849315, 'fraction_numerical': 0.011558219178082191, 'mean_word_length': 2.2413314840499305, 'pattern_counts': {'":': 6, '<': 5, '<?xml version=': 0, '>': 19, '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': '1613233', 'n_tokens_mistral': 771, 'n_tokens_neox': 737, 'n_words': 197}