Prettier console output

This commit is contained in:
Jesse Wierzbinski 2023-10-22 14:32:17 -10:00
parent 35f54d108f
commit ec0544c5ba
No known key found for this signature in database
GPG key ID: F9A1E418934E40B0
3 changed files with 14 additions and 3 deletions

BIN
bun.lockb

Binary file not shown.

View file

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

View file

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