Skip to content

Configurable environment URLs #53

@ubaumann

Description

@ubaumann

It would be nice if we could specify the local URL. I am running the setup in containers and, therefore, cannot use localhost.

For now, I use a workaround:

import os
from textual_web.environment import ENVIRONMENTS, Environment
api_server = os.getenv("API_SERVER", "127.0.0.1:8080")
ENVIRONMENTS["local"] = Environment(
        name="local",
        api_url=f"ws://{api_server}/api/",
        url=f"ws://{api_server}/app-service/",
    )
from textual_web.cli import app


if __name__ == "__main__":
    app(["-e", "local", "-r", "my_command"])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions