"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"));
/**
 * Manages static file serving for vanilla HTML/CSS projects
 */
class StaticFileService {
    projectPath;
    entryPoint;
    constructor(projectPath, entryPoint) {
        this.projectPath = projectPath;
        this.entryPoint = entryPoint;
    }
    /**
     * Get the base path for serving files
     */
    getBasePath() {
        // If entryPoint is a directory, use it as base
        // If entryPoint is a file, use its directory as base
        const entryPath = path_1.default.join(this.projectPath, this.entryPoint);
        const stats = fs_1.default.statSync(entryPath);
        if (stats.isDirectory()) {
            return entryPath;
        }
        else {
            return path_1.default.dirname(entryPath);
        }
    }
    /**
     * Get the entry file name (for serving at root)
     */
    getEntryFileName() {
        const entryPath = path_1.default.join(this.projectPath, this.entryPoint);
        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.map