diff --git a/helpers/database.js b/helpers/database.js new file mode 100644 index 0000000..6ca4370 --- /dev/null +++ b/helpers/database.js @@ -0,0 +1,3 @@ +import { PrismaClient } from "@prisma/client"; +const prisma = new PrismaClient(); +export default prisma; \ No newline at end of file diff --git a/public/primary.css b/public/primary.css new file mode 100644 index 0000000..ec2f93f --- /dev/null +++ b/public/primary.css @@ -0,0 +1,3 @@ +:root { + color-scheme: light dark; +} \ No newline at end of file diff --git a/routes/index.js b/routes/index.js new file mode 100644 index 0000000..09a4ad1 --- /dev/null +++ b/routes/index.js @@ -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; \ No newline at end of file diff --git a/routes/static.js b/routes/static.js new file mode 100644 index 0000000..d1b94a5 --- /dev/null +++ b/routes/static.js @@ -0,0 +1,4 @@ +import { Router, static as static_ } from "express"; +const staticRouter = Router(); +staticRouter.use("/", static_("public")); +export default staticRouter; \ No newline at end of file diff --git a/server.js b/server.js new file mode 100644 index 0000000..8d0189c --- /dev/null +++ b/server.js @@ -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)`); + }) +} \ No newline at end of file diff --git a/views/homepage.ejs b/views/homepage.ejs new file mode 100644 index 0000000..3cb05c6 --- /dev/null +++ b/views/homepage.ejs @@ -0,0 +1,9 @@ + + + + faq-website + + + + + \ No newline at end of file