mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
updated examples: astro, nextjs, remix, bun, node
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { withApi } from "bknd/adapter/nextjs";
|
||||
import type { InferGetServerSidePropsType } from "next";
|
||||
import dynamic from "next/dynamic";
|
||||
|
||||
import { withApi } from "bknd/adapter/nextjs";
|
||||
import "bknd/dist/styles.css";
|
||||
|
||||
const Admin = dynamic(() => import("bknd/ui").then((mod) => mod.Admin), {
|
||||
@@ -14,7 +16,11 @@ export const getServerSideProps = withApi(async (context) => {
|
||||
};
|
||||
});
|
||||
|
||||
export default function AdminPage() {
|
||||
export default function AdminPage({
|
||||
user
|
||||
}: InferGetServerSidePropsType<typeof getServerSideProps>) {
|
||||
if (typeof document === "undefined") return null;
|
||||
return <Admin withProvider config={{ basepath: "/admin" }} />;
|
||||
return (
|
||||
<Admin withProvider={{ user }} config={{ basepath: "/admin", logo_return_path: "/../" }} />
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { serve } from "bknd/adapter/nextjs";
|
||||
|
||||
export const config = {
|
||||
runtime: "experimental-edge",
|
||||
runtime: "edge",
|
||||
// add a matcher for bknd dist to allow dynamic otherwise build may fail.
|
||||
// inside this repo it's '../../app/dist/index.js', outside probably inside node_modules
|
||||
// see https://github.com/vercel/next.js/issues/51401
|
||||
|
||||
Reference in New Issue
Block a user