neddit

the frontend of the frontpage of the internet  https://neddit.ce9e.org
git clone https://git.ce9e.org/neddit.git

commit
c3c3949a03ab5ed48dc9569156a85c603b8a8f76
parent
daf91f775623331acc97fd0e37513584170dfb7d
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2023-10-03 04:43
fix filesystem paths

Diffstat

M neddit.py 7 +++++--

1 files changed, 5 insertions, 2 deletions


diff --git a/neddit.py b/neddit.py

@@ -2,13 +2,16 @@ import argparse
    2     2 import re
    3     3 import functools
    4     4 from datetime import datetime
   -1     5 from pathlib import Path
    5     6 
    6     7 import aiohttp
    7     8 import jinja2
    8     9 from aiohttp import web
    9    10 
   -1    11 BASE_DIR = Path(__file__).parent
   -1    12 
   10    13 env = jinja2.Environment(
   11    -1     loader=jinja2.FileSystemLoader('templates'),
   -1    14     loader=jinja2.FileSystemLoader(BASE_DIR / 'templates'),
   12    15     autoescape=jinja2.select_autoescape(default=True),
   13    16 )
   14    17 
@@ -115,6 +118,6 @@ if __name__ == '__main__':
  115   118     args = parser.parse_args()
  116   119 
  117   120     app = web.Application()
  118    -1     app.router.add_static('/static', 'static')
   -1   121     app.router.add_static('/static', BASE_DIR / 'static')
  119   122     app.router.add_route('GET', '/{path:.*}', generic)
  120   123     web.run_app(app, host='localhost', port=args.port)