Spaces:
Running
on
Zero
Running
on
Zero
File size: 432 Bytes
a746d34 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
from flask import Flask, jsonify
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///stepup.db"
db = SQLAlchemy(app)
@app.route("/api/language_schools", methods=["GET"])
def get_language_schools():
language_schools = LanguageSchool.query.all()
return jsonify([school.to_dict() for school in language_schools])
if __name__ == "__main__":
app.run(debug=True) |