1import { fetchJSON } from "https://esm.town/v/hanu/fetchJSON";
2
3export let ip = await fetchJSON("https://api.ipify.org?format=json");
1export let geolocation = async (req, res) => {
2 const ip = req.options.headers["x-forwarded-for"];
3 const jsonresponse = await $stevekrouse.fetchJSON(
4 `http://ip-api.com/json/${ip}`
5 );
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function getCNNNews() {
4 const response = await fetch(
5 "https://saurav.tech/NewsAPI/everything/cnn.json"
6 );
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Public holidays in the US in 2023
4export let holidaysUS = fetchJSON(
5 "https://date.nager.at/api/v3/PublicHolidays/2023/KR"
6);
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const fetchJavascriptWeeklyIssues = fetch("https://javascriptweekly.com/issues")
4 .then((res) => {
5 const domText = res.text();
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3interface APIResponse {
10 // "https://gisn.tel-aviv.gov.il/arcgis/rest/services/IView2/MapServer/860/query?where=1=1&outFields=*&f=geojson";
11 const url = "https://app.digital4grids.com/api";
12 const json_data = await fetchJSON(url);
13 return { "json_data": [] };
14}
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const githubUser = (async () => {
4 const username = "stevekrouse";
5 const user = await fetchJSON(
6 `https://api.github.com/users/${username}`,
7 );
4 app.get("/", (c) => c.text("Hono yes?"));
5 app.get("/yeah", (c) => c.text("Routing ok!"));
6 return app.fetch(req);
7};
8// Forked from @tmcw.honoExample
1export const CLIBlog = (async () => {
2 // let response = await fetch(
3 // "https://example-files.online-convert.com/document/txt/example.txt",
4 // );
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const buddhaRandomQuote = (async () => {
4 const resp = await fetch("https://buddha-api.com/api/random");
5 const j = await resp.json();
6 const { text, byName } = j;