first
This commit is contained in:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
__pycache__/
|
||||||
|
env
|
||||||
0
battlesnake/__init__.py
Normal file
0
battlesnake/__init__.py
Normal file
36
battlesnake/app.py
Normal file
36
battlesnake/app.py
Normal 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")
|
||||||
9
battlesnake/battlesnake.ini
Normal file
9
battlesnake/battlesnake.ini
Normal 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
4
battlesnake/wsgi.py
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
from app import app
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
app.run()
|
||||||
Reference in New Issue
Block a user