-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #642 from memser-spaceport/stage
feat: Tina decomminssioning
- Loading branch information
Showing
383 changed files
with
8,676 additions
and
10,838 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,2 @@ | ||
# These are retrieved from your project at app.tina.io | ||
NEXT_PUBLIC_TINA_CLIENT_ID=*** | ||
TINA_TOKEN=*** | ||
|
||
# This is set by default CI with Netlify/Vercel/Github, but can be overriden | ||
NEXT_PUBLIC_TINA_BRANCH=*** | ||
|
||
#Token to retrieve announcement | ||
NEXT_PUBLIC_ANNOUNCEMENT_API_TOKEN= |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { NextRequest } from "next/server"; | ||
import fs from "fs"; | ||
import path from "path"; | ||
|
||
function readJsonFiles() { | ||
const folderPath = path.join(process.cwd(), "content/events"); // Get the absolute path to the folder | ||
const fileNames = fs.readdirSync(folderPath); // Read all file names in the folder | ||
|
||
// Filter JSON files and read their contents | ||
const jsonData = fileNames | ||
.filter((file) => file.endsWith(".json")) // Filter only JSON files | ||
.map((file) => { | ||
const filePath = path.join(folderPath, file); // Get the absolute path to the file | ||
const fileContent = fs.readFileSync(filePath, "utf8"); // Read the file contents | ||
return JSON.parse(fileContent); // Parse JSON and return the data | ||
}); | ||
|
||
return jsonData; | ||
} | ||
export async function GET(request: NextRequest) { | ||
try { | ||
// const eventsListData = await client.queries.eventConnection({ last: -1 }); | ||
// const events = eventsListData?.data?.eventConnection?.edges ?? []; | ||
// return Response.json({ data: events }, { status: 200 }); | ||
const jsonData = readJsonFiles(); // Call the utility function with your folder path | ||
return Response.json({ data: jsonData }, { status: 200 }); | ||
} catch (error) { | ||
console.error(error); | ||
return Response.json({ message: "Internal Server Error" }, { status: 500 }); | ||
} | ||
} | ||
|
Oops, something went wrong.