getPublicUrls() method returns all available public HTTPS endpoints for your sandbox container in a single object. By default, Fermion automatically exposes ports 3000, 1337, and 1338, each corresponding to its own unique public URL.
Unlike exposePort(), which retrieves a single URL, getPublicUrls() provides a quick overview of every exposed port at once. It’s a synchronous method, meaning you don’t need to await it, though the URLs it returns remain valid only while the sandbox is active.
You can use this method to configure application settings dynamically: linking web apps, APIs, and socket servers without hardcoding endpoints. The URLs are automatically HTTPS-secured and regenerated with every new sandbox session, ensuring both security and isolation.
getPublicUrls()
Description:
Returns all available public URLs for the sandbox (ports 3000, 1337, 1338).
Parameters:
None
Returns:
Error: "No container found"- Must callcreate()orfromSnippet()first
This is a synchronous method (no await needed), but returns async URLs.
