Start adding content
This commit is contained in:
parent
5031bb1596
commit
ffd28572f0
6 changed files with 41 additions and 0 deletions
3
helpers/database.js
Normal file
3
helpers/database.js
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
import { PrismaClient } from "@prisma/client";
|
||||||
|
const prisma = new PrismaClient();
|
||||||
|
export default prisma;
|
3
public/primary.css
Normal file
3
public/primary.css
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
:root {
|
||||||
|
color-scheme: light dark;
|
||||||
|
}
|
6
routes/index.js
Normal file
6
routes/index.js
Normal 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
4
routes/static.js
Normal 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
16
server.js
Normal 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
9
views/homepage.ejs
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>faq-website</title>
|
||||||
|
<style src="/primary.css"></style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in a new issue