photosite/dist/build.js

23 lines
677 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
require("dotenv/config");
const log_1 = require("./log");
const db_1 = require("./db");
const templates_1 = require("./templates");
class Build {
constructor() {
this.log = (0, log_1.createLog)('build');
this.log.info(`Building site: ${new Date()}`);
this.tmpl = new templates_1.Templates();
this.db = new db_1.DB();
this.main();
}
async main() {
let photos;
await this.tmpl.build();
photos = await this.db.getAll();
await this.tmpl.render('index', { photos });
}
}
new Build();
//# sourceMappingURL=build.js.map