Skip to content

Instantly share code, notes, and snippets.

@5t33
Last active June 29, 2024 18:51
Show Gist options
  • Save 5t33/ce13d98637ab46fada4a7ed39d788ca7 to your computer and use it in GitHub Desktop.
Save 5t33/ce13d98637ab46fada4a7ed39d788ca7 to your computer and use it in GitHub Desktop.
flask_boilerplate.py
from flask import (
Flask,
request
)
app = Flask(__name__)
library = {}
@app.route('/book', methods=['POST'])
def create_book():
data = request.get_json()
library[data['title']] = data
return library[data['title']], 201
if __name__ == '__main__':
app.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment