a. Update CORS settings b. Update session cookie settings c. Remove comments that expose project architecture (and that Claude made most of it :P)
52 lines
824 B
JavaScript
52 lines
824 B
JavaScript
|
|
'use strict';
|
|
|
|
import DOM from './dom.js';
|
|
import Router from './router.js';
|
|
|
|
|
|
class App {
|
|
constructor() {
|
|
this.dom = new DOM();
|
|
this.router = new Router();
|
|
}
|
|
|
|
initialize() {
|
|
this.setupEventListeners();
|
|
this.start();
|
|
}
|
|
|
|
setupEventListeners() {
|
|
// document.addEventListener('click', this.handleGlobalClick.bind(this));
|
|
}
|
|
|
|
handleGlobalClick(event) {
|
|
}
|
|
|
|
start() {
|
|
this.initPageCurrent();
|
|
}
|
|
|
|
initPageCurrent() {
|
|
this.router.loadPageCurrent();
|
|
}
|
|
|
|
}
|
|
|
|
const app = new App();
|
|
|
|
function domReady(fn) {
|
|
if (document.readyState !== 'loading') {
|
|
fn();
|
|
} else {
|
|
document.addEventListener('DOMContentLoaded', fn);
|
|
}
|
|
}
|
|
|
|
domReady(() => {
|
|
app.initialize();
|
|
});
|
|
|
|
window.app = app;
|
|
|
|
export default app; |