Spaces:
Running
on
Zero
Running
on
Zero
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) | |
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) |