← Files RivetARCHIVED FILE
node_modules/rivet-design/dist/services/StaticFileService.js
1.45 KB · Nov 5, 2026 · 12:09 UTC
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.StaticFileService = void 0;
const path_1 = __importDefault(require("path"));
const fs_1 = __importDefault(require("fs"));
class StaticFileService {
projectPath;
entryPoint;
constructor(projectPath, entryPoint) {
this.projectPath = projectPath;
this.entryPoint = entryPoint;
}
getBasePath() {
const entryPath = path_1.default.join(this.projectPath, this.entryPoint);
if (!fs_1.default.existsSync(entryPath)) {
return this.projectPath;
}
const stats = fs_1.default.statSync(entryPath);
if (stats.isDirectory()) {
return entryPath;
}
else {
return path_1.default.dirname(entryPath);
}
}
getEntryFileName() {
const entryPath = path_1.default.join(this.projectPath, this.entryPoint);
if (!fs_1.default.existsSync(entryPath)) {
return path_1.default.basename(entryPath);
}
const stats = fs_1.default.statSync(entryPath);
if (stats.isDirectory()) {
return 'index.html';
}
else {
return path_1.default.basename(entryPath);
}
}
}
exports.StaticFileService = StaticFileService;
//# sourceMappingURL=StaticFileService.js.mapSHA-256: 99c5521a7775252f44e52606f227aa6fc4590deaaccd2ab5a3b8d7075318dfac