Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- #
- from flask import Flask, jsonify, request
- app = Flask(__name__)
- """
- alumnos = [
- {'id':1, 'nombre':'Ale', 'cursos':5},
- {'id':2, 'nombre':'Ana', 'cursos':1},
- {'id':3, 'nombre':'Luisa', 'cursos':2},
- {'id':4, 'nombre':'Juana', 'cursos':3},
- ]
- """
- alumnos = []
- @app.route("/")
- def home():
- return "En el home"
- @app.route("/index")
- def index():
- return "JAJAJA oops... no hay nada"
- if __name__ == "__main__":
- app.run(debug = True)
- # LINUX
- # export FLASK_APP=webserver.py
- # flask run
- # WINDOWS
- # set FLASK_APP=webserver.py
- # python -m flask run
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement