service outages and use nws api
This commit is contained in:
parent
025e993700
commit
22129d5268
5 changed files with 126 additions and 60 deletions
14
src/nws-api/calls.ts
Normal file
14
src/nws-api/calls.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import {Incident, UptimeResponse} from "./types";
|
||||
|
||||
export async function getUptime(): Promise<UptimeResponse> {
|
||||
let response: Response = await fetch('https://api-nws.nickorlow.com/uptime');
|
||||
let uptime: UptimeResponse = await response.json();
|
||||
return uptime;
|
||||
}
|
||||
|
||||
export async function getIncidents(): Promise<Incident[]> {
|
||||
let response: Response = await fetch('https://api-nws.nickorlow.com/incidents');
|
||||
let incidents: Incident[] = await response.json();
|
||||
return incidents;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue