Skip to content

EdgeOne Pages

--preset edgeone-pages writes the output EdgeOne Pages reads. It is chosen when EO_PAGES_CI is set, which EdgeOne sets in its builds, or by name.

Reference

Presetedgeone-pages
Runs onTencent EdgeOne Pages
event.runtime.nameedgeone-pages
Server targetnode
Lifetime, startuprequest, request

Output

text
.edgeone/
  assets/                              the public files and /_hamur/, under app.baseURL
  cloud-functions/ssr-node/
    handler.js
    config.json
    package.json
    server/                            the server bundle

Config keys

This preset has no key of its own.

Detection

The build selects it when EO_PAGES_CI is set, unless --preset, preset or HAMUR_PRESET names another. It is a row of the one table of markers in Choosing a preset.

Deploy command

No hamur deploy command: it exits 1 for this preset. Push the repository to EdgeOne Pages, or deploy .edgeone/ with its CLI.

Limits

  • Experimental: streamed answers, private app/env.ts entries read at run time.
  • Does not run: WebSockets and server.syncedState, server.pubsub, server.metrics, image transforms at run time, Durable Object classes.
  • Rate limits count per instance unless storage.ratelimit is on a shared driver.

The levels are the features of the preset: hamur build warns or fails when the app uses a feature the preset does not run (see Preset features).

text
.edgeone/
  assets/                              the public files and /_hamur/, under app.baseURL
  cloud-functions/ssr-node/
    handler.js                         export default async (req: IncomingMessage) => Response
    config.json                        { "version": 3, "routes": [...] }
    package.json                       "type": "module"
    server/                            the server bundle

handler.js builds the request from the Node IncomingMessage: the URL uses x-forwarded-host or eo-pages-host (the host EdgeOne forwards) when it is a valid host, and x-forwarded-proto; a body over server.maxRequestBodySize is answered 413. The function serves no public file: EdgeOne answers them from assets/ first.

config.json holds routes in Vercel's syntax: the server.securityHeaders, immutable Cache-Control for the build assets and each route rule's headers, then { "handle": "filesystem" } and a catch-all route to the function. Redirects are answered by the function, which keeps the request query: /old/x?a=1 under "/old/**": { redirect: "/new/**" } goes to /new/x?a=1. The build writes no meta.json.

Counting limits (rateLimit) are per instance unless storage.ratelimit is on a shared driver. Hamur deploys nothing: push the repository to EdgeOne Pages, or deploy .edgeone/ with its CLI.