examples: fixing imports due to 0.16 (#226)

This commit is contained in:
dswbx
2025-08-06 08:19:29 +02:00
committed by GitHub
parent bd48bb7a18
commit aa0e6f90d9
6 changed files with 21 additions and 23 deletions

View File

@@ -1,6 +1,5 @@
import { App } from "bknd";
import { serve } from "bknd/adapter/vite";
import { boolean, em, entity, text } from "bknd/data";
import { App, boolean, em, entity, text } from "bknd";
import { secureRandomString } from "bknd/utils";
export default serve({
@@ -8,23 +7,23 @@ export default serve({
data: em({
todos: entity("todos", {
title: text(),
done: boolean()
})
done: boolean(),
}),
}).toJSON(),
auth: {
enabled: true,
jwt: {
secret: secureRandomString(64)
}
}
secret: secureRandomString(64),
},
},
},
options: {
seed: async (ctx) => {
await ctx.em.mutator("todos" as any).insertMany([
{ title: "Learn bknd", done: true },
{ title: "Build something cool", done: false }
{ title: "Build something cool", done: false },
]);
}
},
},
// here we can hook into the app lifecycle events ...
beforeBuild: async (app) => {
@@ -34,10 +33,10 @@ export default serve({
// ... to create an initial user
await app.module.auth.createUser({
email: "ds@bknd.io",
password: "12345678"
password: "12345678",
});
},
"sync"
"sync",
);
}
},
});