This commit is contained in:
parent
ffd28572f0
commit
dd071e9854
10 changed files with 49 additions and 17 deletions
13
.forgejo/workflows/prettier.yml
Normal file
13
.forgejo/workflows/prettier.yml
Normal file
|
@ -0,0 +1,13 @@
|
|||
on:
|
||||
push:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
jobs:
|
||||
prettier:
|
||||
runs-on: docker
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- id: dependencies
|
||||
run: NODE_ENV=development npm ci
|
||||
- id: prettier
|
||||
run: npx prettier --check .
|
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"editor.tabSize": 2
|
||||
}
|
2
README
2
README
|
@ -2,4 +2,4 @@ This is a random project of mine that I spontaneously decided to start working o
|
|||
I did something like this in the past, but I have no idea what happened to it, and it's not public, so let's just call this one the first.
|
||||
Feel free to contribute if you want :)
|
||||
In case you're wondering what this is going to be:
|
||||
I'm trying to create a website that lets people submit questions and associated answers to it for others to see. In other words, a FAQ website :)
|
||||
I'm trying to create a website that lets people submit questions and associated answers to it for others to see. In other words, a FAQ website :)
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
import { PrismaClient } from "@prisma/client";
|
||||
const prisma = new PrismaClient();
|
||||
export default prisma;
|
||||
export default prisma;
|
||||
|
|
16
package-lock.json
generated
16
package-lock.json
generated
|
@ -18,6 +18,7 @@
|
|||
"devDependencies": {
|
||||
"@types/express": "^4.17.21",
|
||||
"@types/node": "^20.14.10",
|
||||
"prettier": "^3.3.2",
|
||||
"prisma": "^5.16.1"
|
||||
}
|
||||
},
|
||||
|
@ -657,6 +658,21 @@
|
|||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
|
||||
"integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ=="
|
||||
},
|
||||
"node_modules/prettier": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz",
|
||||
"integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"prettier": "bin/prettier.cjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/prettier/prettier?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/prisma": {
|
||||
"version": "5.16.1",
|
||||
"resolved": "https://registry.npmjs.org/prisma/-/prisma-5.16.1.tgz",
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
"devDependencies": {
|
||||
"@types/express": "^4.17.21",
|
||||
"@types/node": "^20.14.10",
|
||||
"prettier": "^3.3.2",
|
||||
"prisma": "^5.16.1"
|
||||
},
|
||||
"bin": {
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
:root {
|
||||
color-scheme: light dark;
|
||||
}
|
||||
color-scheme: light dark;
|
||||
}
|
||||
|
|
|
@ -3,4 +3,4 @@ import prisma from "../helpers/database.js";
|
|||
import staticRouter from "./static.js";
|
||||
const faqRouter = new Router();
|
||||
faqRouter.use(staticRouter);
|
||||
export default faqRouter;
|
||||
export default faqRouter;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Router, static as static_ } from "express";
|
||||
const staticRouter = Router();
|
||||
staticRouter.use("/", static_("public"));
|
||||
export default staticRouter;
|
||||
export default staticRouter;
|
||||
|
|
21
server.js
21
server.js
|
@ -2,15 +2,14 @@ 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}`);
|
||||
});
|
||||
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)`);
|
||||
});
|
||||
}
|
||||
else {
|
||||
app.listen(listenHost, () => {
|
||||
console.log(`Listening on ${listenHost} (unix socket)`);
|
||||
})
|
||||
}
|
Loading…
Reference in a new issue