mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
updated examples
This commit is contained in:
20
examples/node/index.js
Normal file
20
examples/node/index.js
Normal 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}`);
|
||||
}
|
||||
});
|
||||
20
examples/node/package.json
Normal file
20
examples/node/package.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "node",
|
||||
"module": "index.js",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "node index.js",
|
||||
"dev": "tsx --watch index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"bknd": "workspace:*",
|
||||
"@hono/node-server": "^1.13.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"tsx": "^4.19.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": "^5.0.0"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user