Added DB schema notes
Compressed imports Added api blueprint
This commit is contained in:
parent
e1aca07cfc
commit
58b6a527eb
15
src/db.py
15
src/db.py
@ -1,5 +1,20 @@
|
||||
import sqlite3
|
||||
|
||||
# tables
|
||||
# manga
|
||||
# chapters_downloaded
|
||||
|
||||
# Schema - manga
|
||||
# id
|
||||
# uuid
|
||||
# title
|
||||
# thumbnail
|
||||
|
||||
# Schema - chapters_downloaded
|
||||
# id
|
||||
# chapter_number
|
||||
# manga_id
|
||||
|
||||
|
||||
class DB:
|
||||
def __init__(self, path):
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
from routes import root
|
||||
from routes import root, api
|
||||
from flask import Flask
|
||||
from os.path import expanduser
|
||||
|
||||
@ -15,3 +15,4 @@ class App(Flask):
|
||||
|
||||
def register_blueprints(self):
|
||||
self.register_blueprint(root.bp)
|
||||
self.register_blueprint(api.bp)
|
||||
|
||||
13
src/routes/api.py
Normal file
13
src/routes/api.py
Normal 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"}
|
||||
@ -1,5 +1,4 @@
|
||||
from flask import Blueprint
|
||||
from flask import current_app
|
||||
from flask import Blueprint, current_app
|
||||
|
||||
bp = Blueprint("root", __name__, url_prefix="/")
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user