<commit_before>from flask import url_for, request
from flask.ext.githubhook.core import do_post

from .core import app
from .logs import setup_logs


setup_logs(app)


@app.route('/')
def do_index():
    return '<pre>Add the following hook to your repos: <strong>%s%s' % (
        request.host_url.rstrip('/'),
        url_for('githubhook.post'),
    )

@app.route('/', methods=['POST'])
def do_redirect():
    return redirect(url_for('githubhook.post'), code=307)
<commit_msg>POST to / calls the hook<commit_after>from flask import url_for, request
from flask.ext.githubhook.core import do_post

from .core import app
from .logs import setup_logs


setup_logs(app)


@app.route('/')
def do_index():
    return '<pre>Add the following hook to your repos: <strong>%s%s' % (
        request.host_url.rstrip('/'),
        url_for('githubhook.post'),
    )

# Register this again, since that is what I have set on all my repos by hand.
app.route('/', methods=['POST'])(do_post)

{'fraction_non_alphanumeric': 0.1406570841889117, 'fraction_numerical': 0.003080082135523614, 'mean_word_length': 4.0, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '6924015', 'n_tokens_mistral': 327, 'n_tokens_neox': 315, 'n_words': 93}