Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternative mechanism to get generated server URL than events #1525

Open
gregpalaci opened this issue Oct 8, 2024 · 0 comments
Open

Alternative mechanism to get generated server URL than events #1525

gregpalaci opened this issue Oct 8, 2024 · 0 comments

Comments

@gregpalaci
Copy link

gregpalaci commented Oct 8, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant