Skip to content

Deploying

Deploy a static site or React, Vue or Angular app

Host a static site or a React, Vue, Angular, Vite, Gatsby or Astro front-end on DployHub with gzip, HTTPS and SPA fallback for client-side routes.

Updated 3 min read

DployHub serves static sites and single-page apps with a fast web server on port 80, gzip compression and HTTPS. Plain HTML sites are served as they are; front-end projects are built first and then served from their output folder. Unknown paths fall back to /index.html, so client-side routing works without extra setup.

Plain HTML sites

If the root folder has an index.html and no Dockerfile, package.json or Python files, we serve the folder as-is. No build step runs. This suits hand-written sites, documentation exports and anything generated before you push.

Front-end frameworks

A package.json with a build script but no server framework is detected as a static front-end. We install dependencies, run the build and serve the output folder:

  • Create React App (react-scripts): build.
  • Vite with React, Vue or Svelte: dist.
  • Vue CLI (@vue/cli-service): dist.
  • Angular: the outputPath from angular.json, plus /browser for the application builder.
  • Gatsby: public.
  • Astro: dist.

A typical Vite project needs nothing special:

json
{
  "scripts": {
    "dev": "vite",
    "build": "vite build"
  },
  "devDependencies": {
    "vite": "5.4.2"
  }
}

Client-side routing

Requests for paths that do not match a file are answered with /index.html. That means a direct visit or refresh on /dashboard/settings loads your app and lets React Router, Vue Router or the Angular router take over. You do not need redirect files.

Keep secrets out of the bundle

Everything in a front-end bundle is downloaded by every visitor, so never put API secrets in your front-end code or in files like .env.production that your build includes. Public values such as an API base URL are fine; secret keys belong in a back-end app, where they can live in environment variables.

Resources and cost

Static sites need very little. The smallest size, 0.25 vCPU with 256 MB memory and 1 GB storage, costs ₹118.50 a month and handles most marketing sites and SPAs. Staging is free. See Resources to size it up later.

Troubleshooting

  • Blank page: check that asset paths are relative to the site root, and that the build produced the folder listed above.
  • Wrong folder served: choose Static website and check the build command, or use your own Dockerfile.
  • Build failed: read the build log in the Deployments tab, then see Build failed.

Quick guides: /deploy/react, /deploy/vue and /deploy/static-site. If something still looks wrong, raise a ticket.

Frequently asked questions

Does client-side routing work after a refresh?

Yes. Unknown paths fall back to /index.html, so routes like /dashboard load your app.

Is gzip compression enabled?

Yes. Static sites are served with gzip on port 80 behind automatic HTTPS.

What is the cheapest size for a static site?

0.25 vCPU, 256 MB memory and 1 GB storage at ₹118.50 a month, plus GST.