-
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.
Server route to generate Merkle Root (#234)
Why: * So we can call this to get a merkle root whenever we need to, for testing purposes How: * Adding `const revalidate = 0` to prevent NextJS cache * Adding the needed env vars to the Github Actions workflow
- Loading branch information
1 parent
faba49a
commit a6a0ea7
Showing
2 changed files
with
15 additions
and
11 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,13 +1,15 @@ | ||
import { generateMerkleRoot } from "@/app/_server/projects/generate-merkle-root"; | ||
|
||
export const revalidate = 0; | ||
|
||
export async function GET(_request: Request) { | ||
// const root = await generateMerkleRoot(); | ||
// | ||
// if (typeof root === 'object' && 'error' in root) { | ||
// return new Response(`Generate root error: ${root.error}`, { | ||
// status: 500, | ||
// }); | ||
// } | ||
// | ||
// return Response.json(root); | ||
|
||
return new Response('root'); | ||
const root = await generateMerkleRoot(); | ||
|
||
if (typeof root === 'object' && 'error' in root) { | ||
return new Response(`Generate root error: ${root.error}`, { | ||
status: 500, | ||
}); | ||
} | ||
|
||
return Response.json(root); | ||
} |