"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.publicUploadUrl = exports.uploadsRoot = void 0;
const node_path_1 = __importDefault(require("node:path"));
const cwd = process.cwd();
const serverRoot = node_path_1.default.basename(cwd) === "server" ? cwd : node_path_1.default.join(cwd, "server");
exports.uploadsRoot = process.env.UPLOAD_DIR
    ? node_path_1.default.resolve(process.env.UPLOAD_DIR)
    : node_path_1.default.join(serverRoot, "uploads");
const publicUploadUrl = (storageKey) => `/uploads/${storageKey.replace(/^\/uploads\//, "")}`;
exports.publicUploadUrl = publicUploadUrl;
//# sourceMappingURL=uploadPaths.js.map