Hosting a static website

Host a static website using open web services in Eyevinn Open Source Cloud. The OSC CLI's web publish command deploys your build directly to My Pages, giving your site its own subdomain with no bucket or CDN setup required. If you need full control over the underlying storage, for example custom bucket names or per-object ACLs, see Option B further down, which uses the MinIO storage service instead.

In this guide

  1. Get an API Access Token and setup project and create a Hello World web application
  2. Build the application
  3. Deploy the build

Prerequisites

Get an API Access Token and setup project

Navigate to Settings / API in the Eyevinn Open Source Cloud web console.

Skärmavbild 2025-01-30 kl  22 54 07

Copy this token and store in your shell's environment in the environment variable OSC_ACCESS_TOKEN.

Create a Hello World web application

In this guide we will start by creating a Hello World application in React. We assume that you have NodeJS installed. Create a new React application by running the following command.

% npx create-react-app hello-world
Need to install the following packages:
create-react-app@5.0.1
Ok to proceed? (y) y

This will create a new directory called “hello-world” containing all the necessary files and dependencies for your React application.

Move into your new app’s directory:

% cd hello-world

Start the development server by running the following command.

% npm start

Your browser will open with this sample application.

Build the application

Build the application to generate the static website. As it will be deployed to a subfolder we need to provide that information when building the website. We do that by setting the environment variable PUBLIC_URL when we build the application.

% PUBLIC_URL=/hello/ npm run build

The generated website is available in the folder called “build” in your directory.

Deploy the build

Run the following command to deploy the build. We name the website “hello”, which becomes its subdomain.

% npx @osaas/cli@latest web publish hello build/
Website published at: https://hello.pages.osaas.io/
Note: My Pages does not provision a dedicated storage bucket for your site,
so 'osc web cdn-create' cannot be pointed at it. Custom domains/CDN in front
of a My Pages site are not yet supported.

In this example the website is published and available at https://hello.pages.osaas.io/. Running the same command again re-publishes the site with the current contents of build/.

Note: Site names are global across all of OSC, so hello is used here only as an example. Pick a name that is likely to be unique, or check availability first with List my static sites via an AI agent, or by browsing My Pages in the web console.

Publishing via AI Agent (MCP)

OSC provides two ways to host a static site through an AI agent connected via MCP.

My Pages is the simplest way to host a static site on OSC. Each site gets its own subdomain on *.pages.osaas.io, with no bucket configuration required. You can also manage sites directly from the My Pages dashboard tab.

See the full guide: User Guide: My Pages.

Ask your agent:

Create a static site called my-docs and publish these files to it: index.html, styles.css

The agent uses a three-step flow:

  1. create-my-page reserves the subdomain (e.g. my-docs.pages.osaas.io)
  2. upload-my-page-files uploads base64-encoded files
  3. publish-my-page makes the site live and enables directory URL resolution

To replace an existing site completely (removing stale files), tell the agent to publish with prune: true and pass the complete file list.

To update an existing site (re-upload files without recreating it):

Update my-docs with the new index.html

To remove a site:

Delete my static site called my-docs

Manage your sites:

List my static sites

Option B: MinIO bucket (for full object storage control)

If you need more control, for example custom bucket names, per-object ACLs, or access to the underlying storage API, use MinIO directly via individual MCP tools. First create a MinIO instance from the MinIO service page, then:

  1. Create a bucket: create-storage-bucket
  2. Make it publicly readable: set-storage-bucket-public
  3. Upload each file: upload-object-to-bucket

Ask your agent:

Create a public MinIO bucket called mysite, then upload index.html and styles.css to it

For subsequent deployments, use upload-object-to-bucket again to overwrite individual files. Use list-objects-on-bucket to inspect what is currently stored.