Install and run prettier
All checks were successful
/ prettier (push) Successful in 1m35s

This commit is contained in:
9pfs 2024-07-06 01:14:20 +00:00
parent ffd28572f0
commit dd071e9854
Signed by: 9pfs
SSH key fingerprint: SHA256:TOcGxMQCfy4VvRM8AzgXErKXdkAtaTcpGXgYMpyoJoY
10 changed files with 49 additions and 17 deletions

View 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
View file

@ -0,0 +1,3 @@
{
"editor.tabSize": 2
}

2
README
View file

@ -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 :)

View file

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

16
package-lock.json generated
View file

@ -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",

View file

@ -16,6 +16,7 @@
"devDependencies": {
"@types/express": "^4.17.21",
"@types/node": "^20.14.10",
"prettier": "^3.3.2",
"prisma": "^5.16.1"
},
"bin": {

View file

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

View file

@ -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;

View file

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

View file

@ -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)`);
})
}