mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
Prettier console output
This commit is contained in:
parent
35f54d108f
commit
ec0544c5ba
16
index.ts
16
index.ts
|
|
@ -1,6 +1,7 @@
|
|||
import { getConfig } from "@config";
|
||||
import { jsonResponse } from "@response";
|
||||
import { MatchedRoute } from "bun";
|
||||
import chalk from "chalk";
|
||||
import { appendFile } from "fs/promises";
|
||||
import { matches } from "ip-matching";
|
||||
import "reflect-metadata";
|
||||
|
|
@ -13,13 +14,13 @@ const router = new Bun.FileSystemRouter({
|
|||
dir: process.cwd() + "/server/api",
|
||||
});
|
||||
|
||||
console.log("[+] Starting Lysand...");
|
||||
console.log(`${chalk.green(`>`)} ${chalk.bold("Starting Lysand...")}`);
|
||||
|
||||
const config = getConfig();
|
||||
const requests_log = Bun.file(process.cwd() + "/logs/requests.log");
|
||||
|
||||
if (!(await requests_log.exists())) {
|
||||
console.log("[+] requests.log does not exist, creating it...");
|
||||
console.log(`${chalk.green(`✓`)} ${chalk.bold("Creating logs folder...")}`);
|
||||
await Bun.write(process.cwd() + "/logs/requests.log", "");
|
||||
}
|
||||
|
||||
|
|
@ -144,4 +145,13 @@ const logRequest = async (req: Request) => {
|
|||
}
|
||||
};
|
||||
|
||||
console.log("[+] Lysand started!");
|
||||
// Remove previous console.log
|
||||
console.clear();
|
||||
|
||||
console.log(
|
||||
`${chalk.green(`✓`)} ${chalk.bold(
|
||||
`Lysand started at ${chalk.blue(
|
||||
`${config.http.bind}:${config.http.bind_port}`
|
||||
)}`
|
||||
)}`
|
||||
);
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-s3": "^3.429.0",
|
||||
"chalk": "^5.3.0",
|
||||
"ip-matching": "^2.1.2",
|
||||
"isomorphic-dompurify": "^1.9.0",
|
||||
"jsonld": "^8.3.1",
|
||||
|
|
|
|||
Loading…
Reference in a new issue