npx wrangler kv namespace listnpx wrangler kv namespace create api-and-kv-example
This file contains hidden or 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
| export default { | |
| async fetch(request: Request) { | |
| const chunkedRequestBody = request.body && chunkStream(request.body); | |
| return new Response(chunkedRequestBody); | |
| }, | |
| }; | |
| // By default will emit chunks of length `chunkSize` (default 256KB). | |
| // If you wish to emit as soon as available, you can pass in `allowPartial: true`, | |
| // you may just end up with more buffers, some smaller than `chunkSize`. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
| import { McpAgent } from "agents/mcp"; | |
| import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; | |
| type Props = { | |
| org: string; | |
| project: string; | |
| }; | |
| type State = { | |
| org?: string; |
This file contains hidden or 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
| CREATE TABLE IF NOT EXISTS movies ( | |
| id INTEGER PRIMARY KEY AUTOINCREMENT, | |
| title TEXT NOT NULL, | |
| release_date TEXT NOT NULL, | |
| rating INT NOT NULL | |
| ); |
This file contains hidden or 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
| // functions/index.js | |
| export async function onRequestGet({ request, env }) { | |
| // Start getting something from "the DB" | |
| const dbPromise = scheduler.wait(1000).then(() => new Date().toDateString()); | |
| // Fetch index.html from cache (body will stream below) | |
| const staticShell = await env.ASSETS.fetch(request); | |
| // The browser will immediately render up until the body closing tag, | |
| // then we insert dom modification scripts as the data is resolved |
This file contains hidden or 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
| aws cloudformation deploy \ | |
| --stack-name pdf2png-app \ | |
| --template-file template.yml \ | |
| --parameter-overrides ImageUri=<accountid>.dkr.ecr.us-east-1.amazonaws.com/pdf2png-app:v1 \ | |
| --capabilities CAPABILITY_IAM |
This file contains hidden or 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
| AWSTemplateFormatVersion: "2010-09-09" | |
| Transform: AWS::Serverless-2016-10-31 | |
| Parameters: | |
| ImageUri: | |
| Type: String | |
| Resources: | |
| ConversionFunction: | |
| Type: AWS::Serverless::Function |
This file contains hidden or 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
| docker run -v "$HOME/.aws":/root/.aws \ | |
| -e AWS_REGION=us-east-1 -e AWS_PROFILE=myprofile \ | |
| -p 9000:8080 \ | |
| pdf2png-test |
NewerOlder