INNER CODE UNIT · JavaScript

PublicService

sailor-sh/CK-X · app/services/public-service.js:4

class PublicService {
    constructor(publicDir) {
        this.publicDir = publicDir;
        this.indexHtmlSrc = path.join(__dirname, '..', 'index.html');
        this.indexHtmlDest = path.join(publicDir, 'index.html');
    }

    initialize() {
        this.createPublicDirectory();
        this.copyIndexHtml();
    }

    createPublicDirectory() {
        if (!fs.existsSync(this.publicDir)) {
            fs.mkdirSync(this.publicDir, { recursive: true });
            console.log('Created public directory');
        }
    }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…