Skip to content

Latest commit

 

History

History
35 lines (23 loc) · 615 Bytes

File metadata and controls

35 lines (23 loc) · 615 Bytes

bsapi

Build Status

A Python implementation of the models in the Battlesnake webhook API.

Example Usage (Bottle)

import bottle

from random import choice
from bsapi.models import *

app = bottle.app()

@app.post('/move')
def move():
    request = SnakeRequest(bottle.request.json)
    return MoveResponse('left')

Example Usage (Flask)

from flask import Flask
from bsapi.models import *

app = Flask(__name__)

@app.route('/move')
def move():
    return MoveResponse('left')