Deploy your project
Put a downloaded WANCode project online for free with static hosting — step by step for plain web projects and React (Vite) projects.
Your projects are static sites: just files (HTML, CSS, JavaScript, images) with no server code. Many hosts serve static sites for free with HTTPS included. This guide stays provider-neutral; pick whichever you like.
Details change
Hosting providers change their sign-up rules, free plans and menus from time to time. The steps below describe how things worked at the time of writing — if a button has moved, check the provider's own documentation.
1. Get your files ready
- Download the project from the Playground (Export ZIP) or a lesson/project (Download project) and unzip it.
- Make sure
index.htmlis at the top of the folder you'll upload. Hosts look for that exact name. - Check your paths are relative (
style.css,images/logo.png, notC:\Users\…) and match file names exactly — most servers are case-sensitive, soLogo.png≠logo.png. - Search your code for anything secret. Everything you deploy can be read by anyone who visits.
2a. Plain HTML/CSS/JS projects
The unzipped folder is already the website. Three common free options:
- Netlify Drop — open app.netlify.com/drop and drag your project folder onto the page. You get a live URL in seconds. Create a free account (or claim the site) if you want it to stay online and to update it later.
- GitHub Pages — create a public repository on GitHub, choose Add file → Upload files and drag in your files, then commit. In the repository's Settings → Pages, set the source to deploy from the
mainbranch, root folder. After a minute or two your site is athttps://<username>.github.io/<repository>/. - Vercel — sign up for a free account, then either import a Git repository (push your files to GitHub first) or run the Vercel CLI from the project folder. For a plain static folder no build settings are needed.
2b. React (Vite) projects
A React project must be built first. The build turns your JSX into plain, optimised files in a dist folder — that folder is what you deploy, not src.
npm install # once
npm run build # creates the dist/ folder
npm run preview # optional: test the built site locally- Netlify Drop: drag the
distfolder (not the whole project) onto the drop page. - Vercel or Netlify with Git: push the whole project (without
node_modulesanddist) to GitHub and import it. They usually detect Vite automatically; if asked, the build command isnpm run buildand the output directory isdist. - GitHub Pages: your site lives under
/<repository>/, so setbase: "/<repository>/"invite.config.jsbefore building. Vite's documentation has a ready-made GitHub Actions workflow for deployingdist.
Don't open dist/index.html by double-clicking it — the built files expect to be served by a web server. Use npm run preview to check the build locally.
3. After it's live
- Open the URL on your phone as well as your computer.
- Open the browser's developer tools and check the Console for 404 errors (usually a wrong path or file-name case).
- To update the site, deploy again (drag the folder again, or push to Git if it's connected).
- A custom domain (like
yourname.my) is optional and usually paid; every host above gives you a free address first.
Front-end code is public
Anything in a static site — including environment variables baked in at build time, such as VITE_ variables — can be read by visitors. Never deploy API secrets in front-end code; they belong on a server.