mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
feat: add local auth support if api storage provided
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import { boolean, em, entity, text } from "bknd";
|
||||
import { Route } from "wouter";
|
||||
import IndexPage from "~/routes/_index";
|
||||
import { BkndBrowserApp, type BrowserBkndConfig } from "bknd/adapter/browser";
|
||||
import { BkndBrowserApp, type BrowserBkndConfig, useApp } from "bknd/adapter/browser";
|
||||
import { type ReactNode, useEffect } from "react";
|
||||
|
||||
const schema = em({
|
||||
todos: entity("todos", {
|
||||
@@ -49,8 +50,17 @@ const config = {
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
<BkndBrowserApp {...config}>
|
||||
<BkndBrowserApp {...config} header={<Debug />}>
|
||||
<Route path="/" component={IndexPage} />
|
||||
</BkndBrowserApp>
|
||||
);
|
||||
}
|
||||
|
||||
const Debug = () => {
|
||||
const { app } = useApp();
|
||||
useEffect(() => {
|
||||
// @ts-ignore
|
||||
window.app = app;
|
||||
}, [app]);
|
||||
return null;
|
||||
};
|
||||
|
||||
@@ -10,24 +10,8 @@ export default defineConfig({
|
||||
optimizeDeps: {
|
||||
exclude: ["sqlocal"],
|
||||
},
|
||||
|
||||
resolve: {
|
||||
dedupe: ["react", "react-dom"],
|
||||
},
|
||||
plugins: [
|
||||
sqlocal(),
|
||||
react(),
|
||||
tailwindcss(),
|
||||
tsconfigPaths(),
|
||||
/* {
|
||||
name: "configure-response-headers",
|
||||
configureServer: (server) => {
|
||||
server.middlewares.use((_req, res, next) => {
|
||||
res.setHeader("Cross-Origin-Embedder-Policy", "require-corp");
|
||||
res.setHeader("Cross-Origin-Opener-Policy", "same-origin");
|
||||
next();
|
||||
});
|
||||
},
|
||||
}, */
|
||||
],
|
||||
plugins: [sqlocal(), react(), tailwindcss(), tsconfigPaths()],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user