""" Main demo page resource for the OpenEventDatabase. """ import falcon from oedb.utils.logging import logger class DemoMainResource: """ Resource for the main demo page. Handles the /demo endpoint. """ def on_get(self, req, resp): """ Handle GET requests to the /demo endpoint. Returns an HTML page with a MapLibre map showing current events. Args: req: The request object. resp: The response object. """ logger.info("Processing GET request to /demo") try: # Set content type to HTML resp.content_type = 'text/html' # Load environment variables from .env file for OAuth2 configuration from oedb.utils.db import load_env_from_file load_env_from_file() # Get OAuth2 configuration parameters import os client_id = os.getenv("CLIENT_ID", "") client_secret = os.getenv("CLIENT_SECRET", "") client_redirect = os.getenv("CLIENT_REDIRECT", "") # Create HTML response with MapLibre map html = """
Une erreur s'est produite lors du chargement des événements.
Consultez le forum OSM pour plus d'informations.