#Unable to access nested functions
2 messages · Page 1 of 1 (latest)
class APIRoute {
path = "";
constructor(path, RunFunction) {
this.path = path;
this.methods = [];
// "if there is logic inside this value"
if (RunFunction) {
// Puts all the route's logic into run
this.run = RunFunction;
// Make a list of all methods used in the route
this.methods.push("test")
}
}
;
// The route's main logic is executed here
run(request, response) {
// This code is a placeholder (just in case)
return new Promise((resolve, reject) => {
resolve();
});
}
;
}
export { APIRoute };
```This is the APIRoute in case you need it