mirror of
https://github.com/shishantbiswas/bknd-examples.git
synced 2026-02-27 03:51:17 +00:00
minor refactors to the adapter code
This commit is contained in:
@@ -1,10 +1,39 @@
|
||||
import type { NextjsBkndConfig } from "bknd/adapter/nextjs";
|
||||
import { type BkndConfig, em, entity, text, boolean } from "bknd";
|
||||
|
||||
// Unrelated to framework adapters
|
||||
import { registerLocalMediaAdapter } from "bknd/adapter/node";
|
||||
|
||||
const local = registerLocalMediaAdapter();
|
||||
|
||||
|
||||
// --------------------- SCHEMA -----------------------
|
||||
// this just for testing
|
||||
const schema = em({
|
||||
todos: entity("todos", {
|
||||
title: text(),
|
||||
done: boolean(),
|
||||
}),
|
||||
post:entity("posts",{
|
||||
title: text(),
|
||||
content: text(),
|
||||
})
|
||||
});
|
||||
|
||||
// --------------------- SCHEMA END -----------------------
|
||||
|
||||
export default {
|
||||
connection: {
|
||||
url: "data.db",
|
||||
},
|
||||
options:{
|
||||
|
||||
}
|
||||
} satisfies NextjsBkndConfig;
|
||||
options: {},
|
||||
config: {
|
||||
data: schema.toJSON(),
|
||||
auth: { enabled: true },
|
||||
media: {
|
||||
enabled: true,
|
||||
adapter: local({
|
||||
path: "./public/uploads",
|
||||
}),
|
||||
},
|
||||
},
|
||||
} satisfies BkndConfig;
|
||||
|
||||
Reference in New Issue
Block a user