Added DB schema notes

Compressed imports
Added api blueprint
This commit is contained in:
Benjamyn Love 2024-04-28 15:25:01 +10:00
parent e1aca07cfc
commit 58b6a527eb
4 changed files with 31 additions and 3 deletions

View File

@ -1,5 +1,20 @@
import sqlite3 import sqlite3
# tables
# manga
# chapters_downloaded
# Schema - manga
# id
# uuid
# title
# thumbnail
# Schema - chapters_downloaded
# id
# chapter_number
# manga_id
class DB: class DB:
def __init__(self, path): def __init__(self, path):

View File

@ -1,4 +1,4 @@
from routes import root from routes import root, api
from flask import Flask from flask import Flask
from os.path import expanduser from os.path import expanduser
@ -15,3 +15,4 @@ class App(Flask):
def register_blueprints(self): def register_blueprints(self):
self.register_blueprint(root.bp) self.register_blueprint(root.bp)
self.register_blueprint(api.bp)

13
src/routes/api.py Normal file
View File

@ -0,0 +1,13 @@
from flask import Blueprint, current_app
bp = Blueprint("api", __name__, url_prefix="/api")
@bp.route("/")
def root():
return current_app.name
@bp.route("/test")
def test():
return {"this works": "How I Expected"}

View File

@ -1,5 +1,4 @@
from flask import Blueprint from flask import Blueprint, current_app
from flask import current_app
bp = Blueprint("root", __name__, url_prefix="/") bp = Blueprint("root", __name__, url_prefix="/")