-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from markusahlstrand/ma/demo-project
demo project
- Loading branch information
Showing
25 changed files
with
543 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,26 @@ | ||
# @authhero/demo | ||
|
||
## 0.1.1 | ||
|
||
### Patch Changes | ||
|
||
- remove the iife build files | ||
- Updated dependencies | ||
- [email protected] | ||
- @authhero/kysely-adapter@0.18.1 | ||
|
||
## 0.1.0 | ||
|
||
### Minor Changes | ||
|
||
- Get the demo project rendering | ||
|
||
### Patch Changes | ||
|
||
- Updated dependencies | ||
- [email protected] | ||
- @authhero/kysely-adapter@0.18.0 | ||
|
||
## 0.0.36 | ||
|
||
### Patch Changes | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
{ | ||
"name": "@authhero/demo", | ||
"private": true, | ||
"version": "0.0.36", | ||
"version": "0.1.1", | ||
"scripts": { | ||
"dev": "bun --watch src/bun.ts" | ||
}, | ||
"dependencies": {} | ||
"dependencies": { | ||
"@authhero/kysely-adapter": "^0.18.1", | ||
"@hono/swagger-ui": "^0.4.1", | ||
"@hono/zod-openapi": "^0.18.0", | ||
"authhero": "^0.10.1", | ||
"hono": "^4.6.11", | ||
"hono-openapi-middlewares": "^1.0.11", | ||
"kysely-bun-sqlite": "^0.3.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { OpenAPIHono } from "@hono/zod-openapi"; | ||
import { PlanetScaleDialect } from "kysely-planetscale"; | ||
import { Kysely } from "kysely"; | ||
import createApp from "./app"; | ||
import createAdapters from "@authhero/kysely-adapter"; | ||
|
||
interface Env { | ||
DATABASE_HOST: string; | ||
DATABASE_USERNAME: string; | ||
DATABASE_PASSWORD: string; | ||
} | ||
|
||
let app: OpenAPIHono | undefined; | ||
|
||
const server = { | ||
async fetch(request: Request, env: Env): Promise<Response> { | ||
if (!app) { | ||
const dialect = new PlanetScaleDialect({ | ||
host: env.DATABASE_HOST, | ||
username: env.DATABASE_USERNAME, | ||
password: env.DATABASE_PASSWORD, | ||
fetch: (opts, init) => | ||
fetch(new Request(opts, { ...init, cache: undefined })), | ||
}); | ||
const db = new Kysely<any>({ dialect }); | ||
const dataAdapter = createAdapters(db); | ||
|
||
app = createApp(dataAdapter); | ||
} | ||
|
||
return app.fetch(request); | ||
}, | ||
}; | ||
|
||
export default server; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export type Bindings = { | ||
JWKS_URL: string; | ||
JWKS_SERVICE: { | ||
fetch: typeof fetch; | ||
}; | ||
AUTH_URL: string; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name = "authhero-demo" | ||
main = "src/server.ts" | ||
compatibility_date = "2024-11-20" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.