'| /? () \/\/
| export const createGqlClient = (authToken: string, API: string) => (async (query) => { | |
| if (!authToken) { | |
| throw "Invalid Auth Token passed"; | |
| } | |
| if (!API) { | |
| throw "Invalid API URL passed"; | |
| } | |
| const response = await fetch(`https://${API}/graphql`, { |
| import { | |
| CognitoIdentityProviderClient, | |
| ListUsersCommand, | |
| AdminDeleteUserCommand, | |
| } from "@aws-sdk/client-cognito-identity-provider"; | |
| const USER_POOL_ID = "your-pool-id"; | |
| const client = new CognitoIdentityProviderClient({ region: "us-east-1" }); |
| import http from "node:http" | |
| const hostname = '0.0.0.0'; | |
| const port = 80; | |
| const server = http.createServer((req, res) => { | |
| res.statusCode = 200; | |
| res.setHeader("Content-Type", "text/html"); | |
| res.end("<h1>Hello from LearnAWS.io</h1>\n"); | |
| }); |
| { | |
| "Version": "2008-10-17", | |
| "Id": "PolicyForCloudFrontPrivateContent", | |
| "Statement": [ | |
| { | |
| "Sid": "AllowCloudFrontServicePrincipal", | |
| "Effect": "Allow", | |
| "Principal": { | |
| "Service": "cloudfront.amazonaws.com" | |
| }, |
| const sleep = (duration) => { | |
| return new Promise((resolve) => { | |
| setTimeout(() => { | |
| resolve(); | |
| }, duration); | |
| }); | |
| }; |
| [ | |
| { | |
| "id": "0189hNRf2g", | |
| "joke": "I'm tired of following my dreams. I'm just going to ask them where they are going and meet up with them later." | |
| }, | |
| { | |
| "id": "08EQZ8EQukb", | |
| "joke": "Did you hear about the guy whose whole left side was cut off? He's all right now." | |
| }, | |
| { |
| [ | |
| "US East (N. Virginia) us-east-1", | |
| "US East (Ohio) us-east-2", | |
| "US West (N. California) us-west-1", | |
| "US West (Oregon) us-west-2", | |
| "Africa (Cape Town) af-south-1", | |
| "Asia Pacific (Hong Kong) ap-east-1", | |
| "Asia Pacific (Jakarta) ap-southeast-3", | |
| "Asia Pacific (Mumbai) ap-south-1", | |
| "Asia Pacific (Osaka) ap-northeast-3", |
| import { TextEncoder } from "util"; | |
| import { SignJWT, jwtVerify } from "jose"; | |
| const secret = process.env.JWT_SECRET ?? "I like bananas"; | |
| const textEncoder = new TextEncoder(); | |
| const keyToSignWith = textEncoder.encode(secret); | |
| const jwt = await new SignJWT({ | |
| email: "[email protected]" |