1export function myApi(name, color = "blue") {
2 return `Hello ${name}, your favorite color is ${color}.`;
3}
1export function myApi(name) {
2 return "hi " + name;
3}
3// GitHub events
4export let githubEvents = fetchJSON(
5 "https://api.github.com/users/stevekrouse/events"
6);
9 shortForecast: string;
10 }
11 interface WeatherApiResponse {
12 properties: {
13 periods: Forecast[];
21 // Fetch the points data to get the forecast endpoint
22 const pointsUrl: string =
23 `https://api.weather.gov/points/${latitude},${longitude}`;
24 console.log(pointsUrl);
25 const pointsResponse = await fetch(pointsUrl, {
33 headers: { "Accept": "application/geo+json" },
34 });
35 const forecastData: WeatherApiResponse = await forecastResponse.json();
36 console.log({ forecastData });
37 return forecastData.properties.periods;
1export function myApi(name) {
2 return "hi " + name;
3}
21
22 const getCompelitoins = async (data) => {
23 const response = await fetch("https://api.openai.com/v1/completions", {
24 method: "POST",
25 headers: {
2
3export const rand = () =>
4 fetchText("http://numbersapi.com/random/math");
1export function myApi(name) {
2 return "hi " + name;
3}
39 </div>
40
41 <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
42 <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
43</body>
1export function myApi(name) {
2 return "hi " + name;
3}