Start adding content

This commit is contained in:
9pfs 2024-07-06 01:08:38 +00:00
parent 5031bb1596
commit ffd28572f0
Signed by: 9pfs
SSH key fingerprint: SHA256:TOcGxMQCfy4VvRM8AzgXErKXdkAtaTcpGXgYMpyoJoY
6 changed files with 41 additions and 0 deletions

3
helpers/database.js Normal file
View file

@ -0,0 +1,3 @@
import { PrismaClient } from "@prisma/client";
const prisma = new PrismaClient();
export default prisma;

3
public/primary.css Normal file
View file

@ -0,0 +1,3 @@
:root {
color-scheme: light dark;
}

6
routes/index.js Normal file
View file

@ -0,0 +1,6 @@
import { Router } from "express";
import prisma from "../helpers/database.js";
import staticRouter from "./static.js";
const faqRouter = new Router();
faqRouter.use(staticRouter);
export default faqRouter;

4
routes/static.js Normal file
View file

@ -0,0 +1,4 @@
import { Router, static as static_ } from "express";
const staticRouter = Router();
staticRouter.use("/", static_("public"));
export default staticRouter;

16
server.js Normal file
View file

@ -0,0 +1,16 @@
import express from "express";
import faqRouter from "./routes/index.js";
const app = express();
app.use(faqRouter);
var listenPort = parseInt(process.env.PORT)||3919;
var listenHost = process.env.HOST||"127.0.0.1";
if(listenHost[0]!="/") {
app.listen(listenPort, listenHost, () => {
console.log(`Listening on ${listenHost}:${listenPort}`);
});
}
else {
app.listen(listenHost, () => {
console.log(`Listening on ${listenHost} (unix socket)`);
})
}

9
views/homepage.ejs Normal file
View file

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>faq-website</title>
<style src="/primary.css"></style>
</head>
<body>
</body>
</html>