fix: fix.env.example

This commit is contained in:
2025-06-14 15:05:20 +07:00
parent b52f1202eb
commit ac10ae14f6
75 changed files with 2532 additions and 2532 deletions

View File

@ -1,26 +1,26 @@
import { Context } from "elysia";
import { UAParser } from "ua-parser-js";
import { UserHeaderInformation } from "./types";
export const getUserHeaderInformation = (
ctx: Context
): UserHeaderInformation => {
const headers = ctx.request.headers;
const userAgentHeader = headers.get("user-agent") || "desktop";
const userAgent = new UAParser(userAgentHeader);
const userIP =
headers.get("cf-connecting-ip") ||
headers.get("x-real-ip") ||
headers.get("x-forwarded-for")?.split(",")[0] ||
"Unknown IP";
const userHeaderInformation = {
ip: userIP,
deviceType: userAgent.getDevice().type || "desktop",
deviceOS: userAgent.getOS().name + " " + userAgent.getOS().version,
browser: userAgent.getBrowser().name + " " + userAgent.getBrowser().version,
};
return userHeaderInformation;
};
import { Context } from "elysia";
import { UAParser } from "ua-parser-js";
import { UserHeaderInformation } from "./types";
export const getUserHeaderInformation = (
ctx: Context
): UserHeaderInformation => {
const headers = ctx.request.headers;
const userAgentHeader = headers.get("user-agent") || "desktop";
const userAgent = new UAParser(userAgentHeader);
const userIP =
headers.get("cf-connecting-ip") ||
headers.get("x-real-ip") ||
headers.get("x-forwarded-for")?.split(",")[0] ||
"Unknown IP";
const userHeaderInformation = {
ip: userIP,
deviceType: userAgent.getDevice().type || "desktop",
deviceOS: userAgent.getOS().name + " " + userAgent.getOS().version,
browser: userAgent.getBrowser().name + " " + userAgent.getBrowser().version,
};
return userHeaderInformation;
};

View File

@ -1,6 +1,6 @@
export interface UserHeaderInformation {
ip: string;
deviceType: string;
deviceOS: string;
browser: string;
}
export interface UserHeaderInformation {
ip: string;
deviceType: string;
deviceOS: string;
browser: string;
}