Skip to content

Instantly share code, notes, and snippets.

@parzibyte

parzibyte/jsonify.py Secret

Created Nov 10, 2020
Embed
What would you like to do?
"""
https://parzibyte.me/blog
"""
from flask import Flask, jsonify
app = Flask(__name__)
@app.route('/')
def inicio():
nombre = "Luis"
return jsonify(nombre)
@app.route('/lista')
def lista():
nombres = ["Luis", "María José", "Maggie", "Panqué"]
return jsonify(nombres)
if __name__ == "__main__":
app.run(host='0.0.0.0', port=8000, debug=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment