Skip to content

Commit

Permalink
cloudflare sst.config.ts example
Browse files Browse the repository at this point in the history
  • Loading branch information
thdxr committed Dec 18, 2024
1 parent 873d1af commit 120b333
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 2 deletions.
Binary file modified bun.lockb
Binary file not shown.
8 changes: 8 additions & 0 deletions examples/authorizer/cloudflare/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "@openauthjs/example-authorizer-cloudflare",
"version": "0.0.0",
"dependencies": {
"@openauthjs/openauth": "workspace:*",
"sst": "3.4.22"
}
}
17 changes: 17 additions & 0 deletions examples/authorizer/cloudflare/sst-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* This file is auto-generated by SST. Do not edit. */
/* tslint:disable */
/* eslint-disable */
/* deno-fmt-ignore-file */
import "sst"
export {}
declare module "sst" {
export interface Resource {
"CloudflareAuth": {
"type": "sst.cloudflare.Worker"
"url": string
}
"CloudflareAuthKV": {
"type": "sst.cloudflare.Kv"
}
}
}
23 changes: 23 additions & 0 deletions examples/authorizer/cloudflare/sst.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/// <reference path="./.sst/platform/config.d.ts" />
export default $config({
app(input) {
return {
name: "openauth-example-cloudflare",
removal: input?.stage === "production" ? "retain" : "remove",
home: "cloudflare",
}
},
async run() {
// cloudflare
const kv = new sst.cloudflare.Kv("CloudflareAuthKV")
const auth = new sst.cloudflare.Worker("CloudflareAuth", {
handler: "./authorizer.ts",
link: [kv],
url: true,
})

return {
url: auth.url,
}
},
})
2 changes: 1 addition & 1 deletion examples/client/jwt-api/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "jwt-api",
"name": "@openauthjs/example-jwt-api",
"version": "1.0.1",
"description": "",
"main": "index.js",
Expand Down
2 changes: 1 addition & 1 deletion examples/client/nextjs/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "nextjs",
"name": "@openauthjs/example-nextjs",
"version": "0.1.6",
"private": true,
"scripts": {
Expand Down

0 comments on commit 120b333

Please sign in to comment.