mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 12:37:20 +00:00
small refactorings and cleanups, improved bun/node adapter, updated docs
This commit is contained in:
@@ -1,22 +1,20 @@
|
||||
import { serve } from "bknd/adapter/node";
|
||||
|
||||
// Actually, all it takes is the following line:
|
||||
// serve();
|
||||
|
||||
// this is optional, if omitted, it uses an in-memory database
|
||||
/** @type {import("bknd").CreateAppConfig} */
|
||||
/** @type {import("bknd/adapter/node").NodeAdapterOptions} */
|
||||
const config = {
|
||||
connection: {
|
||||
type: "libsql",
|
||||
config: {
|
||||
url: "http://localhost:8080"
|
||||
url: ":memory:"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
serve(config, {
|
||||
port: 1337,
|
||||
listener: ({ port }) => {
|
||||
console.log(`Server is running on http://localhost:${port}`);
|
||||
},
|
||||
// this is only required to run inside the same workspace
|
||||
// leave blank if you're running this from a different project
|
||||
relativeDistPath: "../../app/dist"
|
||||
});
|
||||
};
|
||||
|
||||
serve(config);
|
||||
|
||||
Reference in New Issue
Block a user