Skip to content

Commit

Permalink
Add request parameters data
Browse files Browse the repository at this point in the history
  • Loading branch information
CMEONE committed Mar 5, 2021
1 parent 908e9af commit 77c7cec
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ class tApp {
static cacheSize = 0;
static started = false;
static database;
static currentHash = "/";
static get version() {
return "v0.5.0";
return "v0.5.1";
}
static configure(params) {
if(params == null) {
Expand Down Expand Up @@ -346,14 +347,19 @@ class tApp {
if(tApp.config.ignoreRoutes != null && tApp.config.ignoreRoutes instanceof Array && tApp.config.ignoreRoutes.includes(hash)) {

} else if(tApp.routes[hash] != null) {
tApp.routes[hash]();
tApp.routes[hash]({
type: "GET",
referrer: tApp.currentHash,
data: null
});
} else if(tApp.config.forbiddenRoutes != null && tApp.config.forbiddenRoutes instanceof Array && tApp.config.forbiddenRoutes.includes(hash) && tApp.config.errorPages != null && tApp.config.errorPages.forbidden != null) {
tApp.updatePage(tApp.config.errorPages.forbidden);
} else if(tApp.config.errorPages != null && tApp.config.errorPages.notFound != null) {
tApp.updatePage(tApp.config.errorPages.notFound);
} else {
tApp.render("");
}
tApp.currentHash = hash;
}
static loadBackgroundPages() {
for(let i = 0; i < tApp.config.caching.backgroundPages.length; i++) {
Expand Down

0 comments on commit 77c7cec

Please sign in to comment.