18 lines
459 B
Python
18 lines
459 B
Python
|
from app import app, db
|
||
|
from models import User, Achievement
|
||
|
|
||
|
import json
|
||
|
|
||
|
@app.route("/api")
|
||
|
@app.route("/api/all")
|
||
|
def api_all():
|
||
|
return json.dumps([user.to_obj() for user in User.query.all()])
|
||
|
|
||
|
@app.route("/api/users")
|
||
|
def api_all_users():
|
||
|
return json.dumps([user.id for user in User.query.all()])
|
||
|
|
||
|
@app.route("/api/achievements")
|
||
|
def api_all_achievements():
|
||
|
return json.dumps([achievement.to_obj() for achievement in Achievement.query.all()])
|