From 463eafcec4be4415df89d9dbf8d5d0d5598d2796 Mon Sep 17 00:00:00 2001 From: Daniel Kluge Date: Sun, 16 Jan 2022 15:39:19 +0100 Subject: [PATCH] Remove old project files --- lib/projects/index.ts | 21 --------------------- pages/api/get_project.ts | 33 --------------------------------- 2 files changed, 54 deletions(-) delete mode 100644 lib/projects/index.ts delete mode 100644 pages/api/get_project.ts diff --git a/lib/projects/index.ts b/lib/projects/index.ts deleted file mode 100644 index 1cf942d..0000000 --- a/lib/projects/index.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { Project } from "./types"; - -const projectList: Project[] = [ - { - name: "homepage", - short: "This website.", - desc: [ - "This is my homepage.", - "What you see here should resemble an CLI. If you ever used Linux this should be pretty easy for you.", - "Everyone else: Have no fear. It is pretty simple. You just type in commands and the output is shown here or it does something on the webite.", - "To find out, which commands are available, you can type just 'help'.", - "", - "Currently everything is still in development. So if you come back in a few days/weeks/months/years something could have been changed!", - "", - "Have fun!" - ], - repo: "https://git.c0ntroller.de/c0ntroller/frontpage" - } -]; - -export default projectList; \ No newline at end of file diff --git a/pages/api/get_project.ts b/pages/api/get_project.ts deleted file mode 100644 index 0cef4ac..0000000 --- a/pages/api/get_project.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { readFileSync } from "fs"; -import { resolve } from "path"; -import type { NextApiRequest, NextApiResponse } from "next"; - -interface IFileError { - message: string; - name: string; - stack?: string; - code: string; - errno: number; - syscall: string; - path: string; -} - -export default function handler(req: NextApiRequest, res: NextApiResponse) { - if (req.method !== "GET") return res.status(405).end(); - if (!req.query.projectName) return res.status(400).end(); - - const project = req.query.projectName; - - try { - const path = resolve("./public", "projects", `${project}.adoc`); - const data = readFileSync(path).toString(); - console.debug(`[API/get_project]\tRequest for ${project}`); - res.status(200).send(data); - } catch (err) { - console.error(`[API/get_project]\tError in request for ${project}! Code: ${(err as IFileError).code}`); - if ((err as IFileError).code === "ENOENT") res.status(404); - else res.status(500); - } finally { - res.end(); - } -}