37];
38
39function Success() {
40 return (
41 <div className="max-w-md text-lg mx-auto p-6">
2import { useEffect, useState } from "https://esm.sh/react@18.2.0";
3
4async function getCurrentPosition(opts): Promise<GeolocationPosition> {
5 return new Promise((resolve, reject) => {
6 if (!navigator?.geolocation) {
12}
13
14async function reverseGeocodeNominat(lat, lng) {
15 const url = `https://nominatim.openstreetmap.org/reverse?format=json&lat=${lat}&lon=${lng}&zoom=13`;
16 const response = await fetch(url);
19}
20
21export default function Home() {
22 const [locationName, setLocationName] = useState("");
23 useEffect(() => {
13
14// Generic loader that forwards on requests for that page's JSON data
15function loader({ request }) {
16 return fetch(request, {
17 headers: {
22
23// Generic action that forwards on non-get Requests
24function action({ request }) {
25 if (request.method === "GET") { throw Error("GET not expected here - something is wrong."); }
26 return fetch(request);
2import { action as submit_action } from "https://esm.town/v/stevekrouse/dateme_form_react";
3
4async function server(req: Request) {
5 const url = new URL(req.url);
6 if (url.pathname === "/browse") {
13}
14
15function client(req: Request) {
16 return new Response(
17 `<html>
32}
33
34export default function(req: Request) {
35 if (
36 req.headers.get("Content-Type") === "application/json"
1export default async function(req: Request): Promise<Response> {
2 const response = await fetch("http://worldtimeapi.org/api/timezone/America/New_York")
3 const timeData = await response.json()
3const EMOJI_DATA_URL = "https://unicode.org/Public/emoji/15.1/emoji-zwj-sequences.txt";
4
5export async function getCompoundEmojis(): Promise<string[]> {
6 const data = await fetchText(EMOJI_DATA_URL);
7 let result: string[] = [];
1import { OpenAI } from "https://esm.town/v/std/openai";
2export default async function(req: Request): Promise<Response> {
3 const openai = new OpenAI();
4 const stream = await openai.chat.completions.create({
1import { OpenAI } from "https://esm.town/v/std/openai";
2
3export default async function(req: Request): Promise<Response> {
4 const openai = new OpenAI();
5 const stream = await openai.chat.completions.create({
1export default async function(req: Request): Promise<Response> {
2 return new Response(
3 new ReadableStream({
1export default async function(req: Request): Promise<Response> {
2 const { readable, writable } = new TransformStream();
3 const writer = writable.getWriter();