Remove old project files
This commit is contained in:
parent
4b67191aab
commit
463eafcec4
@ -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;
|
@ -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<string>) {
|
||||
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();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user