kenken999's picture
teste
b1ce64c
raw
history blame
489 Bytes
from flask import Flask, jsonify
from flask_marshmallow import Marshmallow
from app.models import db
from app.schemas import ma
from app.services import stop_service
app = Flask(__name__)
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///apistop.db"
db.init_app(app)
ma.init_app(app)
@app.route("/stops", methods=["GET"])
def get_stops():
stops = stop_service.get_all_stops()
return jsonify([stop.to_dict() for stop in stops])
if __name__ == "__main__":
app.run(debug=True)