Add DATABASE_URL env var support for EmDash
- Add .env.example documenting SQLite/PostgreSQL/MySQL config - Add src/lib/db.ts with getDatabaseConfig() helper that parses DATABASE_URL and returns the appropriate db config - Update astro.config.mjs to use getDatabaseConfig() instead of hardcoded sqlite path Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3,7 +3,7 @@ import react from "@astrojs/react";
|
||||
import { auditLogPlugin } from "@emdash-cms/plugin-audit-log";
|
||||
import { defineConfig, fontProviders } from "astro/config";
|
||||
import emdash, { local } from "emdash/astro";
|
||||
import { sqlite } from "emdash/db";
|
||||
import { getDatabaseConfig } from "./src/lib/db.ts";
|
||||
|
||||
export default defineConfig({
|
||||
output: "server",
|
||||
@@ -17,7 +17,7 @@ export default defineConfig({
|
||||
integrations: [
|
||||
react(),
|
||||
emdash({
|
||||
database: sqlite({ url: "file:./storage/data.db" }),
|
||||
database: getDatabaseConfig(),
|
||||
storage: local({
|
||||
directory: "./storage/uploads",
|
||||
baseUrl: "/_emdash/api/media/file",
|
||||
|
||||
Reference in New Issue
Block a user