-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2469d7c
commit 8334e48
Showing
5 changed files
with
90 additions
and
46 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import type { NextApiRequest, NextApiResponse } from "next"; | ||
|
||
const API_ROUTE = process.env.GET_LAP_CORRELATION_MATRIX_URL; | ||
export default async function handler( | ||
req: NextApiRequest, | ||
res: NextApiResponse, | ||
) { | ||
if (!API_ROUTE) { | ||
throw new Error("GET_LAP_CORRELATION_MATRIX_URL is not defined"); | ||
} | ||
try { | ||
const result = await fetch(API_ROUTE); | ||
const graph = await result.json(); | ||
res.status(200).json(graph); | ||
} catch (err) { | ||
res.status(500).json({ error: "failed to load data" + err }); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
packages/client/src/pages/api/getPacketCorrelationMatrix.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import type { NextApiRequest, NextApiResponse } from "next"; | ||
|
||
const API_ROUTE = process.env.GET_PACKET_CORRELATION_MATRIX_URL; | ||
export default async function handler( | ||
req: NextApiRequest, | ||
res: NextApiResponse, | ||
) { | ||
if (!API_ROUTE) { | ||
throw new Error("GET_PACKET_CORRELATION_MATRIX_URL is not defined"); | ||
} | ||
try { | ||
const result = await fetch(API_ROUTE); | ||
const graph = await result.json(); | ||
res.status(200).json(graph); | ||
} catch (err) { | ||
res.status(500).json({ error: "failed to load data" + err }); | ||
} | ||
} |