-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
46 lines (34 loc) · 1.12 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
from fastapi import FastAPI, Request
from fastapi.templating import Jinja2Templates
from fastapi.responses import RedirectResponse, FileResponse, JSONResponse, HTMLResponse, Response
from fastapi.staticfiles import StaticFiles
from json import load
from uvicorn import run
from loomin.packages import jinki
from loomin.custom.JinkiPostProcessors import PostProcessors
with open("config.json", "r") as file:
config = load(file)
app = FastAPI(
docs_url=None,
redoc_url=None
)
## HOME
## The homepage of the loomin wiki server. This homepage can be modified.
@app.get("/")
async def home():
return "Loomin Home HTML here"
## WIKI
## i dont need to explain this
@app.get("/wiki")
async def wiki():
return "selection of wikis here (wikis.json)"
@app.get("/wiki/{wiki}/{content:path}")
async def wiki_content():
return "wiki shenanigans here"
## ASSETS
## Access assets from the github repository (no long paths)
@app.get("/assets/{wiki}/{filename}")
async def asset():
return "return asset now (use github api)"
if __name__ == "__main__":
run("main:app", host="0.0.0.0", port=8080, reload=True, reload_delay=5)