mirror of
https://github.com/DeveloLongScript/MHSF.git
synced 2026-05-09 10:54:59 -05:00
Compare commits
9 Commits
a3476ac054
...
f3f673b4e6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f3f673b4e6 | ||
|
|
fd278b3e8d | ||
|
|
b3d2763106 | ||
|
|
8538ac5672 | ||
|
|
45fcc618c2 | ||
|
|
7e7c1a8648 | ||
|
|
17f444fbf4 | ||
|
|
d1166c4411 | ||
|
|
cbdcc74ce8 |
@ -28,6 +28,10 @@ The primary stack for MHSF is Next.js, a React framework, which you can start by
|
|||||||
[You can also opt out of telemetry if you'd like.](https://nextjs.org/telemetry)
|
[You can also opt out of telemetry if you'd like.](https://nextjs.org/telemetry)
|
||||||
|
|
||||||
## Clerk
|
## Clerk
|
||||||
|
> [!CAUTION]
|
||||||
|
> Clerk is no longer optional. If Clerk is not setup, you *will* get a `Non-authenticated environments are disallowed on this origin.` error on the frontend.
|
||||||
|
> You may be able to modify/test API endpoints as long as they do not require accounts.
|
||||||
|
|
||||||
If you want to test out accounts, [you must create an Clerk key from their website.](https://clerk.com)
|
If you want to test out accounts, [you must create an Clerk key from their website.](https://clerk.com)
|
||||||
Set the following variables in the .env.local file:
|
Set the following variables in the .env.local file:
|
||||||
```dotenv
|
```dotenv
|
||||||
|
|||||||
@ -30,32 +30,33 @@
|
|||||||
import { NextApiRequest, NextApiResponse } from "next";
|
import { NextApiRequest, NextApiResponse } from "next";
|
||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
req: NextApiRequest,
|
req: NextApiRequest,
|
||||||
res: NextApiResponse
|
res: NextApiResponse,
|
||||||
) {
|
) {
|
||||||
const betterStackResult = await fetch(
|
const betterStackResult = await fetch(
|
||||||
`https://uptime.betterstack.com/api/v2/status-pages/${process.env.BS_STATUS_PAGE}/status-reports`,
|
`https://uptime.betterstack.com/api/v2/status-pages/${process.env.BS_STATUS_PAGE}/status-reports`,
|
||||||
{ headers: { Authorization: `Bearer ${process.env.BS_TOKEN}` } }
|
{ headers: { Authorization: `Bearer ${process.env.BS_TOKEN}` } },
|
||||||
);
|
);
|
||||||
const betterStackURL = await fetch(
|
const betterStackURL = await fetch(
|
||||||
`https://uptime.betterstack.com/api/v2/status-pages/${process.env.BS_STATUS_PAGE}`,
|
`https://uptime.betterstack.com/api/v2/status-pages/${process.env.BS_STATUS_PAGE}`,
|
||||||
{ headers: { Authorization: `Bearer ${process.env.BS_TOKEN}` } }
|
{ headers: { Authorization: `Bearer ${process.env.BS_TOKEN}` } },
|
||||||
);
|
);
|
||||||
|
|
||||||
const result = await betterStackResult.json();
|
const result = await betterStackResult.json();
|
||||||
const url = await betterStackURL.json();
|
const url = await betterStackURL.json();
|
||||||
|
|
||||||
const filtered = result.data.filter(
|
const filtered = result.data.filter(
|
||||||
(c: any) =>
|
(c: any) =>
|
||||||
c.attributes.ends_at === null &&
|
c.attributes.ends_at === null &&
|
||||||
c.attributes.affected_resources.filter(
|
c.attributes.affected_resources.filter(
|
||||||
(v: any) =>
|
(v: any) =>
|
||||||
v.status_page_resource_id === process.env.BS_STATUS_MAIN_WEBSITE
|
v.status_page_resource_id === process.env.BS_STATUS_MAIN_WEBSITE &&
|
||||||
).length > 0
|
v.status !== "resolved",
|
||||||
);
|
).length > 0,
|
||||||
|
);
|
||||||
|
|
||||||
res.status(200).send({
|
res.status(200).send({
|
||||||
url: url.data.attributes.custom_domain,
|
url: url.data.attributes.custom_domain,
|
||||||
incidents: filtered,
|
incidents: filtered,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3234,9 +3234,9 @@ cross-fetch@^4.0.0:
|
|||||||
node-fetch "^2.6.12"
|
node-fetch "^2.6.12"
|
||||||
|
|
||||||
cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3:
|
cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3:
|
||||||
version "7.0.3"
|
version "7.0.6"
|
||||||
resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz"
|
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f"
|
||||||
integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==
|
integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==
|
||||||
dependencies:
|
dependencies:
|
||||||
path-key "^3.1.0"
|
path-key "^3.1.0"
|
||||||
shebang-command "^2.0.0"
|
shebang-command "^2.0.0"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user