mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
docs: fixed events, commented edge runtime for nextjs
This commit is contained in:
@@ -29,15 +29,15 @@ const app = createApp();
|
||||
|
||||
app.emgr.onEvent(AppEvents.AppRequest, async (event) => {
|
||||
// ^? AppRequest
|
||||
console.log("Request received", event.request.url);
|
||||
console.log("Request received", event.params.request.url);
|
||||
});
|
||||
|
||||
app.emgr.on("app-request", async (event) => {
|
||||
console.log("Request received", event.request.url);
|
||||
console.log("Request received", event.params.request.url);
|
||||
});
|
||||
|
||||
app.emgr.onAny(async (event) => {
|
||||
console.log("Event received", event.slug);
|
||||
app.emgr.onAny(async (event, name) => {
|
||||
console.log("Event received", event, name);
|
||||
});
|
||||
```
|
||||
|
||||
@@ -49,7 +49,7 @@ import { AppEvents } from "bknd";
|
||||
export default {
|
||||
onBuilt: (app) => {
|
||||
app.emgr.onEvent(AppEvents.AppRequest, async (event) => {
|
||||
console.log("Request received", event.request.url);
|
||||
console.log("Request received", event.params.request.url);
|
||||
});
|
||||
},
|
||||
};
|
||||
@@ -63,7 +63,7 @@ By default, listeners are registered as `async` listeners, meaning that the list
|
||||
app.emgr.onEvent(
|
||||
AppEvents.AppRequest,
|
||||
async (event) => {
|
||||
console.log("Request received", event.request.url);
|
||||
console.log("Request received", event.params.request.url);
|
||||
},
|
||||
{ mode: "sync" },
|
||||
);
|
||||
|
||||
@@ -108,7 +108,7 @@ import { config } from "@/bknd";
|
||||
import { serve } from "bknd/adapter/nextjs";
|
||||
|
||||
// optionally, you can set the runtime to edge for better performance
|
||||
export const runtime = "edge";
|
||||
// export const runtime = "edge";
|
||||
|
||||
const handler = serve({
|
||||
...config,
|
||||
|
||||
Reference in New Issue
Block a user