Publishing what you built in a browser IDE

The preview address works while you are in the tab. Whether it works tomorrow for somebody else is a different question.

A browser development environment is a good place to build. It is a weak place for something to live, and the preview address is the reason people find that out late.

A preview address showing a cold-start delay when opened by somebody else.
A preview address showing a cold-start delay when opened by somebody else.

This guide covers the preview address, the static question, and taking the files out.

The preview address is not hosting

It works while the project is running. Idle projects sleep, and waking one takes seconds.

So a recipient opening the link hours later gets a delay, sometimes an error, and forms an impression of the thing you built that has nothing to do with the thing you built.

It also belongs to the tool. The address changes if the project is renamed, disappears if the account lapses, and identifies which product you used.

For showing a colleague during a session, it is fine. For anything sent to a client, it is not.

The HTML viewer renders it in the browser so you can look before publishing.

Most of what gets built there is static

The useful question: does anything actually need to run.

A secret. A key that must not be public means something has to sit between the page and the service.

Shared changing state. Two people seeing the same updating data.

Background work. Anything that happens while nobody has the page open.

If none of those apply, the project is a set of files. Export them, publish them as a static page, and nothing needs to stay awake.

Static files Needs to keep running
Calculator, tool, prototype Yes
Page with a form posting elsewhere Yes
Anything with a private key Yes
Shared live data Yes
Scheduled work Yes

Taking the files out

Download the project or copy the relevant files.

For a static build, that is an entry file and an assets folder. Publish it anywhere, point your own domain at it, and the result is faster and more reliable than the preview ever was.

Two things to check afterwards. Paths should be relative, because the build may have assumed it was served from the root. And any secret that was set in the environment is not in the files, which is correct and means the project genuinely needed a server if it used one.

An exported project folder beside a published address serving the same page.
An exported project folder beside a published address serving the same page.

Keep a copy outside

A browser environment should not hold the only copy of something you care about.

Accounts lapse, free tiers change, products are discontinued. All of those have happened, and the projects inside went with them.

Export periodically, or push to a repository. It costs a minute and it is the difference between a bad week and a lost project.

Two neighbouring cases are worth a look: Hosting what you built by prompting and How to host a built front end.

Put it at an address

Work out whether anything needs to run, export the files if it does not, stop sending preview addresses to anyone who matters, keep a copy outside, and put your own domain in front of whatever serves it.

Then what you built is reachable tomorrow, by somebody who was not there when you built it.

Questions people ask

Can I just send the preview link?

It works while the project is running and frequently sleeps when it is idle. A recipient opening it hours later may get a cold start, a delay, or nothing.

Does the project need to stay running?

If it has a server, yes, and that is what the paid tiers keep alive. If it is a static page, it does not need anything running at all.

How do I know which I have?

If nothing talks to a database, no private key is used and no work happens when the page is closed, it is static and can be published as files.

What should I take out?

The files. A browser environment is a good place to build and a fragile place to be the only copy of something.

What about the secrets I set in the environment?

Those stay in the environment. If the project needs them at runtime, it needs a server, and that is the case where keeping it running is correct.

Keep reading