Opengist Logo 清羽飞扬の代码片段

Explore

  • All gists
  • Topics
  • Users
个人主页 站长博客
Give feedback on the new UI Powered by Opengist ⋅ 24ms

user:thomas gists created by user

title:mygist gists with given title

description:sync gists with given description

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

all:systemctl search all fields

Login Register
c

cloudflare

Recently created Least recently created Recently updated Least recently updated
LiuShen

LiuShen / 利用CF Worker实现一个每日bing一图接口API

Last active 2 months ago api bing cache cloudflare worker

利用CF Worker实现一个每日bing一图接口API,可以直接用作图片数据。

0 0 1
1 // 利用api.nsmao.net实现的bing接口
2 const API_KEY = "ajdlfklahweufbrffbhjefjfsmd,shj" // 自行申请API
3 const CACHE_TTL = 36000 // 10 小时
4
5 export default {
6 async fetch(request, env, ctx) {
7 const { pathname } = new URL(request.url)
8
9 // 首页说明
10 if (pathname === "/") {
LiuShen

LiuShen / 通过cloudflare Worker创建github api中间件

Last active 2 months ago Javascript cloudflare commit github-api worker

通过cloudflare Worker创建github api中间件,在隐藏token的情况下获取仓库提交信息

0 0 1
1 /**
2 * Welcome to Cloudflare Workers! This is your first worker.
3 *
4 * - Run "npm run dev" in your terminal to start a development server
5 * - Open a browser tab at http://localhost:8787/ to see your worker in action
6 * - Run "npm run deploy" to publish your worker
7 *
8 * Learn more at https://developers.cloudflare.com/workers/
9 */