mirror of
https://github.com/yeicor-3d/yet-another-cad-viewer.git
synced 2026-01-31 02:24:14 +01:00
solving lots of production issues
This commit is contained in:
@@ -26,11 +26,12 @@ show_all = server.show_cad_all
|
||||
def _get_app() -> web.Application:
|
||||
"""Required by aiohttp-devtools"""
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
from logo import build_logo
|
||||
from logo import build_logo, ASSETS_DIR
|
||||
logo, img_location, img_path = build_logo()
|
||||
server.show_cad(logo, 'Logo')
|
||||
server.show_cad(img_location, 'Location')
|
||||
server.show_cad(logo, 'logo')
|
||||
server.show_cad(img_location, 'location')
|
||||
server.show_image(img_path, img_location, 20)
|
||||
server.show_gltf(open(os.path.join(ASSETS_DIR, 'fox.glb'), 'rb').read(), 'fox')
|
||||
return server.app
|
||||
|
||||
|
||||
|
||||
@@ -20,7 +20,16 @@ from mylogger import logger
|
||||
from pubsub import BufferedPubSub
|
||||
from tessellate import _hashcode, tessellate
|
||||
|
||||
FRONTEND_BASE_PATH = os.getenv('FRONTEND_BASE_PATH', '../dist')
|
||||
# Find the frontend folder (optional, but recommended)
|
||||
FILE_DIR = os.path.dirname(__file__)
|
||||
FRONTEND_BASE_PATH = os.getenv('FRONTEND_BASE_PATH', os.path.join(FILE_DIR, 'frontend'))
|
||||
if not os.path.exists(FRONTEND_BASE_PATH):
|
||||
if os.path.exists(os.path.join(FILE_DIR, '..', 'dist')): # Fallback to dev build
|
||||
FRONTEND_BASE_PATH = os.path.join(FILE_DIR, '..', 'dist')
|
||||
else:
|
||||
logger.warning('Frontend not found at %s', FRONTEND_BASE_PATH)
|
||||
|
||||
# Define the API paths (also available at the root path for simplicity)
|
||||
UPDATES_API_PATH = '/api/updates'
|
||||
OBJECTS_API_PATH = '/api/object' # /{name}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user