1import { upstashRateLimiter } from "https://esm.town/v/zzz/upstashRateLimiter";
2
3// https://api.val.town/v1/express/zzz.RateLimitDemo
4export async function RateLimitDemo(req, res) {
5 const ip = req.get("true-client-ip") ??
9 // Verify this webhook came from our bot
10 if (
11 req.get("x-telegram-bot-api-secret-token") !==
12 process.env.telegramWebhookSecret
13 ) {
1export function myApi(name) {
2 return "hi " + name;
3}
5 options = {},
6) => {
7 // Initialize OpenAI API stub
8 const { Configuration, OpenAIApi } = await import(
9 "https://esm.sh/openai@3.3.0"
10 );
11 const configuration = new Configuration({
12 apiKey: process.env.OPENAI,
13 });
14 const openai = new OpenAIApi(configuration);
15 // Request chat completion
16 const messages = typeof prompt === "string"
1export function myApi(name) {
2 return "hi " + name;
3}
1export function myApi(name) {
2 return "hi " + name;
3}
1import { getYoutubeLinkFromPage } from "https://esm.town/v/wilt/getYoutubeLinkFromPage";
2
3export async function getYoutubeLinkFromPageAPI(req: Request) {
4 const url = new URL(req.url).searchParams.get("url");
5 if (!url || url === "undefined")
3
4export const upscaleThisUrl = async (req, res) => {
5 const authToken = process.env.REPLICATE_API_TOKEN;
6 const url = "https://api.replicate.com/v1/predictions";
7 const jobId = req.body?.jobId;
8 const imageUrl = req.body?.imageUrl;
1export function myApi(name) {
2 return "hi " + name;
3}
1export function myApi(name) {
2 return "hi " + name;
3}