1
2
3
4
5
6
7
8
9
import process from "node:process";
import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
// e.g. https://www.sfmta.com/stops/carl-st-stanyan-st-13915
export const getMuniStopInfo = (stopCode) => {
return fetchJSON(
`https://api.511.org/transit/StopMonitoring?api_key=${process.env.transitApiKey}&agency=SF&stopCode=${stopCode}`,
);
};
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
October 23, 2023