Write basic content
This commit is contained in:
parent
99ee4820af
commit
4c6e1fbdb4
3 changed files with 15 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -58,3 +58,4 @@ docs/_build/
|
||||||
# PyBuilder
|
# PyBuilder
|
||||||
target/
|
target/
|
||||||
|
|
||||||
|
venv
|
||||||
|
|
2
Makefile
Normal file
2
Makefile
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
dev-run: gogsmaker.py
|
||||||
|
FLASK_APP=$< flask run
|
13
gogsmaker.py
13
gogsmaker.py
|
@ -2,4 +2,15 @@
|
||||||
|
|
||||||
A webhook-handler for Gogs running `make` when needed. """
|
A webhook-handler for Gogs running `make` when needed. """
|
||||||
|
|
||||||
from flask import Flask
|
from flask import Flask, request
|
||||||
|
|
||||||
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@app.route('/', methods=['POST'])
|
||||||
|
def view_root():
|
||||||
|
payload = request.json
|
||||||
|
if payload is None:
|
||||||
|
return 'Expected json\n', 415
|
||||||
|
print(payload)
|
||||||
|
return 'OK\n', 200
|
||||||
|
|
Loading…
Reference in a new issue