<commit_before>express = require 'express'
routes = require './routes'

app = module.exports = express()
app.set 'views', __dirname + '/templates'
app.set 'view engine', 'jade'

app.get '/user/refresh', routes.refresh

app.get '/profile/edit', routes.settings
app.get '/user/edit', routes.settings
app.get '/user/delete', routes.settings
app.get '/user/saves', routes.settings

adminOnly = require '../../lib/middleware/admin_only'

app.get '/user/auctions', adminOnly, routes.settings
app.get '/user/payments', adminOnly, routes.settings
<commit_msg>Limit to staging (admin restriction is tricky with Stripe)<commit_after>express = require 'express'
routes = require './routes'

app = module.exports = express()
app.set 'views', __dirname + '/templates'
app.set 'view engine', 'jade'

app.get '/user/refresh', routes.refresh

app.get '/profile/edit', routes.settings
app.get '/user/edit', routes.settings
app.get '/user/delete', routes.settings
app.get '/user/saves', routes.settings

{ NODE_ENV } = require '../../config'
stagingOrDevelopmentOnly = (req, res, next) ->
  if NODE_ENV in ['development', 'staging']
    next()
  else
    err = new Error
    err.status = 403
    next err

app.get '/user/auctions', stagingOrDevelopmentOnly, routes.settings
app.get '/user/payments', stagingOrDevelopmentOnly, routes.settings

{'fraction_non_alphanumeric': 0.15483383685800603, 'fraction_numerical': 0.0022658610271903325, 'mean_word_length': 4.408163265306122, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3062001', 'n_tokens_mistral': 423, 'n_tokens_neox': 409, 'n_words': 112}