Installation

Pages is built into PocketOne as the pages extension (ext/pages). There is nothing to install from npm: the standard pocketone binary includes it.

Step 1: Install PocketOne and create an app.

On macOS or Linux, with Homebrew:

brew install pocketonehq/tap/pocketone
pocketone pages create myapp

On Windows, with Scoop (or see Windows without Scoop):

scoop bucket add pocketonehq https://github.com/pocketonehq/scoop-bucket
scoop install pocketone
pocketone pages create myapp

Step 2: Run.

cd myapp
pocketone superuser upsert [email protected] <password> --dir ./pb_data
pocketone serve --dir ./pb_data --dev

pocketone pages create myapp creates a new app. Add --starter <kit> to start from a starter kit.

Note: --dir tells pocketone where pb_data is. Pages looks for pb_pages next to it. Create the superuser before the first serve; otherwise PocketBase opens its superuser installer in your browser.

Browse to http://localhost:8090 and you'll see the starter's home page. The default minimal kit is one splash page:

http://localhost:8090

PocketOne

To start editing, open

myapp/pb_pages/index.ets

Changes appear on the next refresh. The app doesn't restart.

Where pages live

Pages live in their own folder next to PocketBase's others:

myapp/
  pb_data/  pb_hooks/  pb_migrations/  pb_public/
  pb_pages/
  • Pages finds the folder at pb_pages next to pb_data, or wherever --pagesDir points.
  • If the folder doesn't exist, the extension does nothing for that app.
  • Under a multitenant host, every instance has its own pb_pages.

How does it work?

Pages is a multi-page app server for PocketOne. It listens for requests and renders pages using file-based routing rules, like old-school PHP. URLs under /api/ and /_/ always belong to PocketBase. A URL nothing in pb_pages matches goes on to pb_public, then to PocketBase.