added some stuff for running on my server
This commit is contained in:
1 parent
d22af9734e
commit
c172cafdbc
6 files changed
+20
-8
No files matched your search
@@ -3,6 +3,7 @@ import configparser
|
||||
import random
|
||||
|
||||
import flask
|
||||
import waitress
|
||||
|
||||
from post import Post
|
||||
|
||||
@@ -14,10 +15,12 @@ config.read(CONFIG_PATH)
|
||||
|
||||
POSTS_FOLDER = config['POSTS']['POSTS_FOLDER']
|
||||
STATUS_FILE = config['STATUS']['STATUS_FILE']
|
||||
PORT = int(config['NETWORK']['PORT'])
|
||||
DEV = int(config['NETWORK']['DEV'])
|
||||
|
||||
def get_posts(category_filter : str | None = None) -> list[Post]:
|
||||
post_files= glob.glob(f'{POSTS_FOLDER}/*')
|
||||
post_files.remove(f'{POSTS_FOLDER}\\POST_TEMPLATE.md')
|
||||
post_files = glob.glob(f'{POSTS_FOLDER}/*')
|
||||
post_files.remove(f'{POSTS_FOLDER}/POST_TEMPLATE.md')
|
||||
|
||||
posts: list[Post] = []
|
||||
for post_file in post_files:
|
||||
@@ -67,4 +70,7 @@ def index():
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run()
|
||||
if DEV:
|
||||
app.run(port=PORT)
|
||||
else:
|
||||
waitress.serve(app, host='0.0.0.0', port=PORT)
|
||||
@@ -25,4 +25,4 @@ What do you mean ... You can't see it?
|
||||
I don't believe you, your eyes deceive you, better check yourself in
|
||||
You will say I'm crazy, I will go on my way 'cause it's what I need
|
||||
I'd cross a thousand seas just to prove I'm not mad
|
||||
I thoguht I saw a statue blink, and a bird with no head, Land on a golden thread, I rub my eyes, What am I saying? There's nothing there
|
||||
I thought I saw a statue blink, and a bird with no head, Land on a golden thread, I rub my eyes, What am I saying? There's nothing there
|
||||
Reference in new issue
Block a user