From 7929bd183ca3ad24a850c599944a63ed9ce61e0d Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Thu, 25 Oct 2018 13:19:46 +0100 Subject: [PATCH] Init base flask server --- Pipfile | 17 +++++++++++ Pipfile.lock | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++ Procfile | 1 + server.py | 10 ++++++ 4 files changed, 114 insertions(+) create mode 100644 Pipfile create mode 100644 Pipfile.lock create mode 100644 Procfile create mode 100644 server.py diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..a79ed51 --- /dev/null +++ b/Pipfile @@ -0,0 +1,17 @@ +[[source]] +url = "https://pypi.org/simple" +verify_ssl = true +name = "pypi" + +[packages] +flask = "*" +github-webhook = "*" +waitress = "*" + +[dev-packages] + +[requires] +python_version = "3.7" + +[scripts] +start = "python3 server.py" diff --git a/Pipfile.lock b/Pipfile.lock new file mode 100644 index 0000000..e1caf8b --- /dev/null +++ b/Pipfile.lock @@ -0,0 +1,86 @@ +{ + "_meta": { + "hash": { + "sha256": "1eb29aa9673cd7d91dede603696d3e62320d46140c57acc70904b7a597d8b4a3" + }, + "pipfile-spec": 6, + "requires": { + "python_version": "3.7" + }, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.org/simple", + "verify_ssl": true + } + ] + }, + "default": { + "click": { + "hashes": [ + "sha256:2335065e6395b9e67ca716de5f7526736bfa6ceead690adf616d925bdc622b13", + "sha256:5b94b49521f6456670fdb30cd82a4eca9412788a93fa6dd6df72c94d5a8ff2d7" + ], + "version": "==7.0" + }, + "flask": { + "hashes": [ + "sha256:2271c0070dbcb5275fad4a82e29f23ab92682dc45f9dfbc22c02ba9b9322ce48", + "sha256:a080b744b7e345ccfcbc77954861cb05b3c63786e93f2b3875e0913d44b43f05" + ], + "index": "pypi", + "version": "==1.0.2" + }, + "github-webhook": { + "hashes": [ + "sha256:089c7b00c3711565dc14a9b741ef64383d2934a64961676d586b6ab558101030", + "sha256:5b13f43f1b764f688426f166c69d0dcdc4a1d88fa87a9017d127ed5752714d12" + ], + "index": "pypi", + "version": "==1.0.2" + }, + "itsdangerous": { + "hashes": [ + "sha256:a7de3201740a857380421ef286166134e10fe58846bcefbc9d6424a69a0b99ec", + "sha256:aca4fc561b7671115a2156f625f2eaa5e0e3527e0adf2870340e7968c0a81f85" + ], + "version": "==1.0.0" + }, + "jinja2": { + "hashes": [ + "sha256:74c935a1b8bb9a3947c50a54766a969d4846290e1e788ea44c1392163723c3bd", + "sha256:f84be1bb0040caca4cea721fcbbbbd61f9be9464ca236387158b0feea01914a4" + ], + "version": "==2.10" + }, + "markupsafe": { + "hashes": [ + "sha256:a6be69091dac236ea9c6bc7d012beab42010fa914c459791d627dad4910eb665" + ], + "version": "==1.0" + }, + "six": { + "hashes": [ + "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9", + "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb" + ], + "version": "==1.11.0" + }, + "waitress": { + "hashes": [ + "sha256:40b0f297a7f3af61fbfbdc67e59090c70dc150a1601c39ecc9f5f1d283fb931b", + "sha256:d33cd3d62426c0f1b3cd84ee3d65779c7003aae3fc060dee60524d10a57f05a9" + ], + "index": "pypi", + "version": "==1.1.0" + }, + "werkzeug": { + "hashes": [ + "sha256:c3fd7a7d41976d9f44db327260e263132466836cef6f91512889ed60ad26557c", + "sha256:d5da73735293558eb1651ee2fddc4d0dedcfa06538b8813a2e20011583c9e49b" + ], + "version": "==0.14.1" + } + }, + "develop": {} +} diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..5d618a3 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: waitress-serve --port $PORT server:app diff --git a/server.py b/server.py new file mode 100644 index 0000000..4d6c62d --- /dev/null +++ b/server.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python3 +from flask import Flask +from github_webhook import Webhook + + +app = Flask(__name__) +webhook = Webhook(app) + +if __name__ == "__main__": + app.run(host="0.0.0.0")