Skip to content

Commit

Permalink
add load
Browse files Browse the repository at this point in the history
  • Loading branch information
leeyoshinari committed Jul 28, 2024
1 parent 5118bd3 commit f2a4fdc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# -*- coding: utf-8 -*-
# @Author: leeyoshinari
import os
import sys
import time
import json
import asyncio
Expand All @@ -16,7 +17,10 @@
from request import Request
from draw_performance import draw_data_from_db


if hasattr(sys, 'frozen'):
current_path = os.path.dirname(sys.executable)
else:
current_path = os.path.dirname(os.path.abspath(__file__))
server = Process()
http = Request()

Expand Down Expand Up @@ -271,9 +275,9 @@ async def notice(request):

async def main():
app = web.Application()
aiohttp_jinja2.setup(app, loader=jinja2.FileSystemLoader('templates')) # Add template to search path
aiohttp_jinja2.setup(app, loader=jinja2.FileSystemLoader(os.path.join(current_path, 'templates'))) # Add template to search path
app.router.add_static(f'{cfg.getServer("serverContext")}/static/',
path=os.path.join(os.path.dirname(os.path.abspath(__file__)), 'static'),
path=os.path.join(current_path, 'static'),
append_version=True) # Add static files to the search path

app.router.add_route('GET', f'{cfg.getServer("serverContext")}', index)
Expand Down

0 comments on commit f2a4fdc

Please sign in to comment.