Skip to main content

StoryBooker Core

Core is the heart of StoryBooker. It provides the routing and rendering logic for StoryBooker, and is framework agnostic.

API Docs

It also provides

  • a set of utilities for building custom adapters and integrations.
  • simple adapters for using local filesystem for storage and database (for testing and development purposes).

Install

npm i @storybooker/core

API

createHonoRouter

API Docs

Callback to create a Hono router that can be used as a request handler.

The Hono router can be deployed to any platform that supports Hono framework.

Read more about options

createPurgeHandler

API Docs

Callback to create a purge-handler based on provided options.

Purging deletes all builds older than certain days based on Project's configuration.

Note: The latest build on project's default branch is not deleted.

Adapters (for testing)

LocalFileDatabase

API Docs

A simple database adapter that uses local file to store data. Defaults to ./db.json file.

LocalFileStorage

API Docs

A simple storage adapter that uses local folder to store files. Defaults to current folder.

Examples