This repository contains custom extensions for our Directus-based database, providing additional functionality and custom API endpoints tailored for Klimadashboard.
To create a new custom extension, follow these steps:
-
Recommended Resources
While the official Directus extension docs are useful, we especially recommend this more practical guide:
π Proxy an external API in a custom endpoint extension -
Generate a New Extension
Inside theextensions/folder, run:npx create-directus-extension@latest
Then follow the interactive setup to define your extension.
-
Choose Your Language
You can write your extension in either JavaScript (index.js) or TypeScript (index.ts) β choose whichever you're more comfortable with. -
Set a Unique Endpoint ID
In yoursrc/index.jsorsrc/index.tsfile, make sure to:- Define a unique
idfor your endpoint. - Use a clear, descriptive URI that reflects the purpose of the endpoint.
- Define a unique
Deployment is currently handled manually by David.
- Important: Each extension folder is automatically prefixed with
directus-extension-during deployment. No need to add this manually. - Note: Deployments require a full Directus restart, which makes continuous deployment currently impractical.