<commit_before>from flask import Flask, render_template, jsonify, request
from werkzeug.contrib.fixers import ProxyFix

app = Flask(__name__)

app.wsgi_app = ProxyFix(app.wsgi_app)

def output(req, data):
  if req.headers['Content-Type'] == 'application/json':
    return jsonify(data)
  elif req.headers['Content-Type'] == 'text/plain':
    return data['main']
  else:
    return render_template('api.html', content = data)


@app.route('/')
def index():
  return render_template('index.html', title="Doge As A Service") 

# Such wow
@app.route('/wow/<arg>')
def show_wow(arg):
  main = 'wow such %s.' % arg
  content = {'title': 'wow', 'main': main}
  return output(request, content)

@app.route('/very/<arg>')
def show_very(arg):
  main = 'very %s. wow.' % arg
  content={'title': 'very', 'main': main}
  return output(request, content)

@app.route('/little/<arg>')
def show_little(arg):
  main = 'little %s. wow.' % arg
  content={'title': 'little', 'main': main}
  return output(request, content)


@app.route('/wat/<arg>')
def show_wat(arg):
  main = 'wat r u doin, %s.' % arg
  content={'title': 'wat', 'main': main}
  return output(request, content)


@app.route('/omg/<arg>')
def show_omg(arg):
  main = 'omg such %s. wow.' % arg
  content={'title': 'omg', 'main': main}
  return output(request, content)
  
# many variable
@app.route('/plz/<to>/<sender>')
def show_plz(to, sender):
  main = '%s plz' % to
  content={'title': 'plz', 'main': main, 'optional': sender }
  return output(request, content)

@app.route('/thx/<to>/<sender>')
def show_thx(to, sender):
  main = 'thx %s' % to
  content={'title': 'to', 'main': main, 'optional': sender}
  return output(request, content)

@app.route('/fuk/<to>/<sender>')
def show_fuk(to, sender):
  main = 'fuk u %s' % to
  content = {'title': 'fuk u', 'main': main, 'optional': sender }
  return output(request, content) 

if __name__ == '__main__':
  app.run()<commit_msg>json function causing issues in production, removing it for the time being<commit_after>from flask import Flask, render_template, jsonify, request
from werkzeug.contrib.fixers import ProxyFix

app = Flask(__name__)

app.wsgi_app = ProxyFix(app.wsgi_app)

@app.route('/')
def index():
  return render_template('index.html', title="Doge As A Service") 

# Such wow
@app.route('/wow/<arg>')
def show_wow(arg):
  main = 'wow such %s.' % arg
  content = {'title': 'wow', 'main': main}
  return render_template('api.html', content=content)

@app.route('/very/<arg>')
def show_very(arg):
  main = 'very %s. wow.' % arg
  content={'title': 'very', 'main': main}
  return render_template('api.html', content=content)

@app.route('/little/<arg>')
def show_little(arg):
  main = 'little %s. wow.' % arg
  content={'title': 'little', 'main': main}
  return render_template('api.html', content=content)


@app.route('/wat/<arg>')
def show_wat(arg):
  main = 'wat r u doin, %s.' % arg
  content={'title': 'wat', 'main': main}
  return render_template('api.html', content=content)


@app.route('/omg/<arg>')
def show_omg(arg):
  main = 'omg such %s. wow.' % arg
  content={'title': 'omg', 'main': main}
  return render_template('api.html', content=content)
  
# many variable
@app.route('/plz/<to>/<sender>')
def show_plz(to, sender):
  main = '%s plz' % to
  content={'title': 'plz', 'main': main, 'optional': sender }
  return render_template('api.html', content=content)

@app.route('/thx/<to>/<sender>')
def show_thx(to, sender):
  main = 'thx %s' % to
  content={'title': 'to', 'main': main, 'optional': sender}
  return render_template('api.html', content=content)

@app.route('/fuk/<to>/<sender>')
def show_fuk(to, sender):
  main = 'fuk u %s' % to
  content = {'title': 'fuk u', 'main': main, 'optional': sender }
  return orender_template('api.html', content=content)

if __name__ == '__main__':
  app.run()
{'fraction_non_alphanumeric': 0.19837950862519602, 'fraction_numerical': 0.0, 'mean_word_length': 4.703427719821162, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '1897943', 'n_tokens_mistral': 1433, 'n_tokens_neox': 1408, 'n_words': 358}