source code of my personal home server https://git.ari.lt/ari/homeserver
Find a file
Ari Archer c3dddd68e1
make files.js ask for confirmation on account deletion
Signed-off-by: Ari Archer <ari.web.xyz@gmail.com>
2023-01-02 04:58:48 +02:00
scripts add files subapp, improve code in general 2023-01-01 04:42:03 +02:00
src make files.js ask for confirmation on account deletion 2023-01-02 04:58:48 +02:00
.editorconfig init 2022-12-31 09:16:20 +02:00
.eslintrc.js init 2022-12-31 09:16:20 +02:00
.gitignore init 2022-12-31 09:16:20 +02:00
LICENSE init 2022-12-31 09:16:20 +02:00
package-lock.json init 2022-12-31 09:16:20 +02:00
package.json init 2022-12-31 09:16:20 +02:00
pyproject.toml add files subapp, improve code in general 2023-01-01 04:42:03 +02:00
README.md init 2022-12-31 09:16:20 +02:00
requirements.txt add starts subapp 2023-01-02 03:24:46 +02:00
tox.ini init 2022-12-31 09:16:20 +02:00

homeserver

source code of my personal home server

running

$ python3 src/main.py

subapps

subapp is a concept in this project which allows for multiple flask apps to be squished together, but also stay seperated, it also has a prep system

to make a subapp make a file in src/homeserver folder called app_<subapp name>.py and in it you should have at least one variable of type flask.Blueprint called the same as your subapp, thats the app youll be working with

if you need any prep to the pain app make a prep_<your subapp name> function, its signature should be (flask.Flask) -> None

also, defining __doc__ gives it a description, HTML is allowed

example subapp:

app_example.py

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""example <i>flask app</i>"""

from flask import Blueprint

example: Blueprint = Blueprint("example", __name__)


@example.get("/")
def index() -> str:
    return "<h1>example app</h1>"

all resources needed for subapps should go into the subapp_res package