Front-end and static sites
How to put a React app online
In short
To put a React app online, upload the code with package.json and a build script — without the node_modules folder or a ready-made build. Netrun recognizes React, runs the build with Vite, Create React App or another bundler, and serves the finished files at an HTTPS link. A new version goes live at the same address when you update the code.
- Once built, a React app is a set of static files: HTML, JavaScript and CSS.
- Netrun runs the build itself, so the node_modules folder and a finished build do not need uploading.
- Projects on Vite, Create React App and other bundlers work as long as package.json has a build script.
- Environment variables are baked into frontend code at build time, so any visitor can read a secret key placed in a React app.
- Apps on Vue, Svelte and other frontend frameworks are published the same way.
Normally, to show your React app to the world, you have to build it with a build command, upload the finished folder to a host, and set things up so the routes work correctly. That is several steps, and it is easy to slip up on any of them.
Netrun figures out on its own that this is React, builds the project, and serves it at a link. All that is left for you is the code. Let us walk through it step by step.
Prepare the project#
Make sure the project has a package.json with a build script (Vite, Create React App, or another bundler) and that the project builds on your own machine.
Upload the code to Netrun#
As a ZIP archive or by importing from GitHub. You do not need to include the node_modules folder or the built output — we install the dependencies and build the project ourselves.
Netrun builds the app#
The platform recognizes React, runs the build, and prepares the finished files for serving — you do not need to configure the build command by hand.
Get a link#
Once the build is done, Netrun gives you a public address with HTTPS that anyone can open the app at.
Update it#
To put a new version online, update the code — Netrun rebuilds the app at the same address.
Apps on Vue, Svelte, and other front-end frameworks deploy the same way. If the code was generated by an AI, just upload it as is. Try Netrun.
Common questions
Why can't my React app see environment variables?
Bundlers only pass variables with a special prefix into browser code: VITE_ in Vite and REACT_APP_ in Create React App. The values are inserted at build time, so after changing them you need to publish the project again.
Can I keep an API key in a React app?
Not if the key is secret: anything that ends up in the frontend can be read in the browser. Requests that need a secret key go through your own backend, where the key lives in environment variables, and React calls that backend instead.
Do I need to upload the dist or build folder?
No. Netrun installs the dependencies and builds the project itself, so the source code with package.json is enough. Just make sure the project builds locally without errors using the same build command.
Is the Free plan enough for a React site?
Yes: on the Free plan a site lives as long as you like, sleeps without visitors and wakes on its own when someone opens it. The first load after sleep takes a few seconds; to keep the site from sleeping, you need the Pro plan.
How do I update a published React app?
Upload the new version of the code in your dashboard — as an archive, from GitHub or by publishing again from your AI editor — and Netrun rebuilds the app at the same address. There is no automatic publishing on git push.