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
| async function handleRequest(request) { | |
| // We pass the url as the first argument to fetch and an object with | |
| // additional info like headers, method, and body for POST requests as | |
| // the second argument. By default fetch makes a GET request, | |
| // so we can skip specifying method for GET requests. | |
| const response = await fetch("https://api.github.com/users/denoland", { | |
| headers: { | |
| // Servers use this header to decide on response body format. | |
| // "application/json" implies that we accept the data in JSON format. | |
| accept: "application/json", |
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
| // 钉钉机器人 webhook 请求,在 figma 插件中存在跨域限制,这个 proxy 脚本可以解决这个问题。 | |
| // https://gist.github.com/mayneyao/0688303382f999f9cfeed082a733fc0e | |
| // deno deploy 暂不支持私密仓库的部署,先使用公开的 gist。 | |
| async function handleRequest(request) { | |
| // For making a POST request we need to specify the method property | |
| // as POST and provide data to the body property in the same object. | |
| // https://post.deno.dev echoes data we POST to it. | |
| const url = new URL(request.url); | |
| const text = url.searchParams.get("text") |
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
| openapi: 3.0.0 | |
| servers: | |
| - url: //petstore.swagger.io/v2 | |
| description: Default server | |
| - url: //petstore.swagger.io/sandbox | |
| description: Sandbox server | |
| info: | |
| description: | | |
| This is a sample server Petstore server. | |
| You can find out more about Swagger at |
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 os | |
| import time | |
| from vika import Vika | |
| API_TOKEN = '你的 api token' | |
| DST_ID = '存储图片的表id' | |
| file_dir = '/Users/mayne/Desktop/demo' # 需要上图片的文件路径 | |
| vika = Vika(API_TOKEN) |
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
| /** | |
| * Welcome to Cloudflare Workers! This is your first worker. | |
| * | |
| * - Run "npm run dev" in your terminal to start a development server | |
| * - Open a browser tab at http://localhost:8787/ to see your worker in action | |
| * - Run "npm run deploy" to publish your worker | |
| * | |
| * Learn more at https://developers.cloudflare.com/workers/ | |
| */ |
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 uuid | |
| import requests | |
| BASE_URL = "http://localhost:3333" | |
| class DataSpace: | |
| def __init__(self, space_id): | |
| self.space_id = space_id |
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
| // Cloudflare supports the GET, POST, HEAD, and OPTIONS methods from any origin, | |
| // and allow any header on requests. These headers must be present | |
| // on all responses to all CORS preflight requests. In practice, this means | |
| // all responses to OPTIONS requests. | |
| const allowOrigin = 'https://eidos.space'; | |
| const corsHeaders = { | |
| 'Access-Control-Allow-Origin': allowOrigin, | |
| 'Access-Control-Allow-Methods': 'GET,HEAD,POST,OPTIONS', |
OlderNewer