ガイド一覧

React · Vue · Svelte (SPA)

Static builds (Vite etc.) are served by nginx automatically, with SPA fallback.

  1. 1Detection

    If package.json uses a static build tool (vite, react-scripts…) and no server start script, it's treated as an SPA: the build output (dist or build) is served by nginx on $PORT with index.html fallback.

    json
    "scripts": {
      "dev": "vite",
      "build": "vite build"
    }
  2. 2Deploy (pick one)

    ① Connect GitHub: Project → Add service → GitHub repository (deploys on push) ② From this folder: oc up --wait (builds even without a Dockerfile) ③ Upload a folder or zip in the console: Add service → Upload source

    bash
    oc login
    oc project create my-app --link
    oc up --wait
  3. 3API URL

    VITE_* variables are embedded at build time. Use your backend service's public URL.

    bash
    oc variables set VITE_API_URL=https://api-my-app.app.onecloud.im

関連ガイド