Skip to content

Alternative mechanism to get generated server URL than events #1525

@jswhisperer

Description

@jswhisperer

Working in embedded webviews it's difficult to get events as they are overwritten (in my case)
I would be nice to have an alternative to server-ready event

	webcontainerInstance.on("server-ready", (port: any, url: string) => {
			webc.value = url;
		});

If it was on the instance somewhere rather just await npm start should be sufficent to know the server is running.

await webcontainerInstance
			.spawn("npm", ["run", "start"])
			.then((deets) => {
				webc.value = "http://localhost:3111"; // or deets.url ?
			})
			.catch((e: any) => console.log(e));

or webcontainerInstance.url

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