mirror of
https://github.com/DeveloLongScript/MHSF.git
synced 2026-05-09 13:44:58 -05:00
Compare commits
8 Commits
6943ed13c0
...
76ee70400d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
76ee70400d | ||
|
|
fd278b3e8d | ||
|
|
b3d2763106 | ||
|
|
8538ac5672 | ||
|
|
45fcc618c2 | ||
|
|
7e7c1a8648 | ||
|
|
17f444fbf4 | ||
|
|
0ec55b125e |
@ -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
|
||||||
|
|||||||
@ -66,7 +66,7 @@
|
|||||||
"remark-gfm": "^4.0.0",
|
"remark-gfm": "^4.0.0",
|
||||||
"sonner": "^1.7.0",
|
"sonner": "^1.7.0",
|
||||||
"stripe-gradient": "^1.0.1",
|
"stripe-gradient": "^1.0.1",
|
||||||
"tailwind-merge": "^2.3.0",
|
"tailwind-merge": "^3.0.1",
|
||||||
"tailwindcss-animate": "^1.0.7",
|
"tailwindcss-animate": "^1.0.7",
|
||||||
"tailwindcss-patch": "^4.0.0",
|
"tailwindcss-patch": "^4.0.0",
|
||||||
"turbo": "^2.4.0",
|
"turbo": "^2.4.0",
|
||||||
|
|||||||
@ -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,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
12
yarn.lock
12
yarn.lock
@ -102,7 +102,7 @@
|
|||||||
resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.24.7.tgz"
|
resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.24.7.tgz"
|
||||||
integrity sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw==
|
integrity sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw==
|
||||||
|
|
||||||
"@babel/runtime@^7.13.10", "@babel/runtime@^7.23.2", "@babel/runtime@^7.24.1", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.7":
|
"@babel/runtime@^7.13.10", "@babel/runtime@^7.23.2", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.7":
|
||||||
version "7.24.8"
|
version "7.24.8"
|
||||||
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.8.tgz#5d958c3827b13cc6d05e038c07fb2e5e3420d82e"
|
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.8.tgz#5d958c3827b13cc6d05e038c07fb2e5e3420d82e"
|
||||||
integrity sha512-5F7SDGs1T72ZczbRwbGO9lQi0NLjQxzl6i4lJxLxfW9U5UluCSyEJeniWvnhl3/euNiqQVbo8zruhsDfid0esA==
|
integrity sha512-5F7SDGs1T72ZczbRwbGO9lQi0NLjQxzl6i4lJxLxfW9U5UluCSyEJeniWvnhl3/euNiqQVbo8zruhsDfid0esA==
|
||||||
@ -7827,12 +7827,10 @@ synckit@^0.9.1:
|
|||||||
"@pkgr/core" "^0.1.0"
|
"@pkgr/core" "^0.1.0"
|
||||||
tslib "^2.6.2"
|
tslib "^2.6.2"
|
||||||
|
|
||||||
tailwind-merge@^2.3.0:
|
tailwind-merge@^3.0.1:
|
||||||
version "2.3.0"
|
version "3.0.1"
|
||||||
resolved "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-2.3.0.tgz"
|
resolved "https://registry.yarnpkg.com/tailwind-merge/-/tailwind-merge-3.0.1.tgz#0f0189966511ebcd63ef98d9eaf5607beb0d59d3"
|
||||||
integrity sha512-vkYrLpIP+lgR0tQCG6AP7zZXCTLc1Lnv/CCRT3BqJ9CZ3ui2++GPaGb1x/ILsINIMSYqqvrpqjUFsMNLlW99EA==
|
integrity sha512-AvzE8FmSoXC7nC+oU5GlQJbip2UO7tmOhOfQyOmPhrStOGXHU08j8mZEHZ4BmCqY5dWTCo4ClWkNyRNx1wpT0g==
|
||||||
dependencies:
|
|
||||||
"@babel/runtime" "^7.24.1"
|
|
||||||
|
|
||||||
tailwindcss-animate@^1.0.7:
|
tailwindcss-animate@^1.0.7:
|
||||||
version "1.0.7"
|
version "1.0.7"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user