expose_port() method provides a public HTTPS URL that maps directly to a specific port running inside your sandbox container.Fermion automatically supports ports 3000, 1337, and 1338, allowing you to host web servers, APIs, or other networked services securely and access them from anywhere. When you start a server inside your sandbox (for example, using
python -m http.server or node server.js), you can call expose_port(port) to instantly retrieve a URL in the format:https://{subdomain}-{port}.run-code.com
This allows you to preview, test, and share live web apps or APIs running within your sandbox.
expose_port(port: int) -> str
Description:Returns the public HTTPS URL for a specific port inside the sandbox.
Currently, Fermion supports public exposure for ports 3000, 1337, and 1338.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
port | int | Yes | Port number (must be one of 3000, 1337, or 1338) |
Returns:
str : Public HTTPS URL in the format https://{subdomain}-{port}.run-code.com.
Example - Start and expose a Node.js server
