updated examples

This commit is contained in:
dswbx
2024-11-23 11:21:25 +01:00
parent 2433833ad0
commit f70e2b2e10
13 changed files with 74 additions and 64 deletions

20
examples/node/index.js Normal file
View File

@@ -0,0 +1,20 @@
import { serve } from "bknd/adapter/node";
// this is optional, if omitted, it uses an in-memory database
/** @type {import("bknd").CreateAppConfig} */
const config = {
connection: {
type: "libsql",
config: {
url: "http://localhost:8080"
}
}
};
serve(config, {
relativeDistPath: "../../node_modules/bknd/dist",
port: 1337,
listener: ({ port }) => {
console.log(`Server is running on http://localhost:${port}`);
}
});