Skip to content

Commit

Permalink
Update app.js
Browse files Browse the repository at this point in the history
  • Loading branch information
rayc2045 committed Apr 16, 2024
1 parent a67a5e5 commit 0f0abd3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,8 @@ const router = {
this.currentPath = path.startsWith('/') ? path : '/';
},
async getPageHTML(path = this.currentPath) {
const root = './src/pages';
const page =
this.routes.find(route => route.path === path)?.component || '/404.html';
return await fetch(root + page).then(res => res.text());
return await fetch(`./src/pages${page}`).then(res => res.text());
},
};

0 comments on commit 0f0abd3

Please sign in to comment.