Skip to content

Commit 024ff8a

Browse files
author
Frank
committed
Examples: sync playground
1 parent d4c65da commit 024ff8a

2 files changed

Lines changed: 9 additions & 36 deletions

File tree

examples/internal/playground/sst-env.d.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,6 @@ declare module "sst" {
6868
"MyVpc": {
6969
"type": "sst.aws.Vpc"
7070
}
71-
"RouterAuthIssuer": {
72-
"name": string
73-
"type": "sst.aws.Function"
74-
"url": string
75-
}
76-
"RouterAuthStorage": {
77-
"name": string
78-
"type": "sst.aws.Dynamo"
79-
}
8071
"Web": {
8172
"type": "sst.aws.StaticSite"
8273
}

examples/internal/playground/sst.config.ts

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ export default $config({
1010
},
1111
async run() {
1212
const ret: Record<string, $util.Output<string>> = {};
13-
const GOOGLE_CLIENT_ID = new sst.Secret("GOOGLE_CLIENT_ID");
14-
const GOOGLE_CLIENT_SECRET = new sst.Secret("GOOGLE_CLIENT_SECRET");
1513

1614
const vpc = addVpc();
1715
const bucket = addBucket();
@@ -82,6 +80,8 @@ export default $config({
8280
}
8381

8482
function addAuth() {
83+
const GOOGLE_CLIENT_ID = new sst.Secret("GOOGLE_CLIENT_ID");
84+
const GOOGLE_CLIENT_SECRET = new sst.Secret("GOOGLE_CLIENT_SECRET");
8585
const auth = new sst.aws.Auth("MyAuth", {
8686
domain: "auth.playground.sst.sh",
8787
issuer: {
@@ -289,13 +289,13 @@ export default $config({
289289
aliases: ["*.router.playground.sst.sh"],
290290
},
291291
});
292-
router.route("api.router.playground.sst.sh/", app.url);
293-
router.route("/api", app.url, {
294-
rewrite: {
295-
regex: "^/api/(.*)$",
296-
to: "/$1",
297-
},
298-
connectionTimeout: "1 second",
292+
//router.route("api.router.playground.sst.sh/", app.url);
293+
router.route("/api1", app.url, {
294+
//rewrite: {
295+
// regex: "^/api/(.*)$",
296+
// to: "/$1",
297+
//},
298+
//connectionTimeout: "1 second",
299299
});
300300
//router.routeSite("/rr7", rr7);
301301
//router.routeSite("/astro5", astro5);
@@ -308,24 +308,6 @@ export default $config({
308308
//router.routeSite("/vite", vite);
309309
//router.routeSite("/", nextjs);
310310

311-
// Add auth
312-
const authStorage = new sst.aws.Dynamo("RouterAuthStorage", {
313-
fields: { pk: "string", sk: "string" },
314-
primaryIndex: { hashKey: "pk", rangeKey: "sk" },
315-
ttl: "expiry",
316-
});
317-
318-
const authIssuer = new sst.aws.Function("RouterAuthIssuer", {
319-
handler: "functions/auth/index.handler",
320-
link: [GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, authStorage],
321-
url: true,
322-
});
323-
324-
router.route(
325-
"/", // <---- this doesn't work. CF is giving me 502's. if I add the domain from the Router, it does work.
326-
authIssuer.url
327-
);
328-
329311
return router;
330312
}
331313

0 commit comments

Comments
 (0)