generated from azures04/Base-REST-API
Refactor API for game file download and listing
Removed user registration and user info endpoints, along with related schemas, services, and tests. Added new routes and service for listing and downloading game files. Updated README to reflect new API purpose. Refactored logger and utils for improved modularity.
This commit is contained in:
@@ -41,7 +41,7 @@ function write($stream, level, color, content, extraLabels = []) {
|
||||
|
||||
function createLogger(root) {
|
||||
// eslint-disable-next-line no-useless-escape
|
||||
const fileName = utils.isTrueFromDotEnv("IS_PROD") ? new Date().toLocaleString("fr-FR", { timeZone: "UTC" }).replace(/[\/:]/g, "-").replace(/ /g, "_") : "DEV-LOG"
|
||||
const fileName = isTrueFromDotEnv("IS_PROD") ? new Date().toLocaleString("fr-FR", { timeZone: "UTC" }).replace(/[\/:]/g, "-").replace(/ /g, "_") : "DEV-LOG"
|
||||
|
||||
const logsDir = path.join(root, "logs")
|
||||
|
||||
@@ -76,6 +76,10 @@ function createLogger(root) {
|
||||
}
|
||||
}
|
||||
|
||||
function isTrueFromDotEnv(key) {
|
||||
return (process.env[key] || "").trim().toLowerCase() === "true"
|
||||
}
|
||||
|
||||
function stripColors(string) {
|
||||
if (!string || typeof string !== "string") {
|
||||
return string
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
const path = require("node:path")
|
||||
const Logger = require("./logger")
|
||||
const logger = Logger.createLogger(path.join(__dirname, ".."))
|
||||
const logger = require("./logger")
|
||||
|
||||
function sendValidationError(req, res, zodResult, type, path, errorConfig) {
|
||||
const ip = req.headers["x-forwarded-for"] || req.socket.remoteAddress
|
||||
|
||||
Reference in New Issue
Block a user