Skip to main content
ollieshop function dev is a local mini-hub: it builds every function in functions/, loads your .env, and runs the same request/response pipeline the production hub runs, with the upstream call going to the real platform URL you give it. Nothing is deployed and no login is needed.

Project layout

function.json mirrors the record’s settings in the Admin, so the local pipeline matches what production does:
function.json
A folder without function.json is still built; the terminal tells you it is only reachable by direct invocation.

What you see

Build errors are shown as ✗ [fraud-check] message (line N) and do not stop the server.

Running the pipeline

POST /run takes a request description, runs every function whose trigger matches, performs the real upstream call, and returns everything that happened:
executions[].status is success, error, error:skipped (failed, but onError is skip) or no-match. With onError: throw, the first failure stops the pipeline and error carries the function id and message. Functions run in priority order, lowest first, then by name. The body can also carry headers (an object), body and session (the initial session storage). Requests to localhost, private networks and .local/.internal hosts are refused with Destination is not allowed.

Invoking one function

POST /invoke?name=<folder or id> runs a single function with an event you build yourself, without the pipeline or the upstream call. Handy for unit-style checks:
Here headers is an array of [name, value] pairs. The reply contains the resulting req, res and session.

What is not emulated

  • Secrets come from your .env, not from the store’s Environment Variables. Copy the values you need locally.
  • The session storage cookie, cookie forwarding to the browser, and the hub’s timeouts are approximated; verify cookie behaviour on a deployed function.
  • The checkout is not involved. You drive the pipeline with curl or the replay request, not by clicking in a store.
  • Functions: the handler contract, triggers, session storage and cookies
  • deploy: shipping the function once it works locally