This commit is contained in:
2021-10-13 21:35:46 +00:00
commit 4a3a67e0d0
5 changed files with 51 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
__pycache__/
env

0
battlesnake/__init__.py Normal file
View File

36
battlesnake/app.py Normal file
View File

@@ -0,0 +1,36 @@
from flask import Flask, jsonify, request
app = Flask(__name__)
@app.route("/")
def home():
return jsonify(
{
"apiversion": "1",
"author": "zevaverbach",
"head": "default",
"color": "#E1AD01",
"tail": "default",
"version": "0.0.1-beta",
}
)
@app.route("/start", methods=["POST"])
def start():
pass
@app.route("/move", methods=["POST"])
def move():
return jsonify({"move": "up"})
@app.route("/end", methods=["POST"])
def end():
pass
if __name__ == "__main__":
app.run(host="0.0.0.0")

View File

@@ -0,0 +1,9 @@
[uwsgi]
module = wsgi:app
master = true
processes = 5
socket = battlesnake.sock
chmod-socket = 660
vacuum = true
die-on-term = true
touch-reload = /home/vagrant/PythonVision/app.py

4
battlesnake/wsgi.py Normal file
View File

@@ -0,0 +1,4 @@
from app import app
if __name__ == "__main__":
app.run()