Bando Documentation
Configuration
Configure the project and register the collections that represent your application's content.
What is the configuration for?
Bando needs to know two important things before running the application:
- Where the database that stores the documents is located.
- Which collections are part of the project.
This information lives in bando.config.ts.
import { defineConfig } from "bando-cms";
import { posts } from "./collections/posts.js";
export default defineConfig({
database: {
url: process.env.DATABASE_URL,
},
collections: [posts],
});
database.url
database.url tells Bando how to connect to PostgreSQL.
In the example, we use process.env.DATABASE_URL. This means the value comes from an environment variable instead of being written directly in the code.
collections
collections tells Bando which collections have been registered by the application.
A collection is the definition of a content type. For example, a blog can have a collection called posts.
| Parâmetro | Tipo | Obrigatório | Por omissão | Descrição |
|---|---|---|---|---|
database.url | string | não | — | PostgreSQL connection URL. If missing, the runtime uses DATABASE_URL and then the predefined local URL. |
collections | array or record | yes | — | Collections available to the runtime. At least one registered collection is required. |