Enjoy PocketPages? Give it a star on GitHub 🎉

Installation

Installing PocketPages is easy.

Step 1: Install pocketpages.
bun add pocketpages
pnpm add pocketpages
yarn add pocketpages
npm add pocketpages
Step 2: Copy the minimal starter.
cp node_modules/pocketpages/starters/minimal/pb_hooks pb_hooks
Step 3: Run.
pocketbase --dir=pb_data --dev serve 

Note: --dir=pb_data is necessary to tell PocketBase to use the current directory for data storage.

Browse to http://localhost:8090 and with any luck at all, you'll see:

http://localhost:8090
Hello, world!

To start editing, find

./pb_hooks/pages/index.ejs

Changes appear immediately on the next refresh.

How does it work?

PocketPages is a PocketBase JS Hooks library. It needs to live in the pb_hooks directory so PocketBase can see it and run it. From there, it parses the pb_hooks/pages directory.

pages doesn't strictly need to live in pb_hooks, but it's nice to put it there because PocketBase will pick up any changes during local development.