← @mortar-kit/core/server

ContentServerOptionsinterface

import { ContentServerOptions } from '@mortar-kit/core/server'

interface ContentServerOptions<User = unknown>

Options for createContentServer.

Properties

content: Content

The app's createContent(...).

auth: false | { require: any }

Who may write: auth.require(request) resolves for a signed-in editor and throws a Response otherwise (createAuth from @mortar-kit/auth). false leaves writes open to anyone: only for local experiments.

canWrite?: (write: ContentWrite<User>) => boolean | Promise<boolean>

Which writes a signed-in editor may make, after auth let them in: false refuses the write with a 403 ("Not allowed"), which the admin shows. Default: every editor may write everything. A collection's own canWrite (defineCollection) is checked after this one, and both must allow.