change loading

merge-requests/1/merge
Matthew 2019-11-16 20:04:00 -05:00
parent ceb2e54e99
commit cc0416c67e
No known key found for this signature in database
GPG Key ID: 766BE43AE75F7559
2 changed files with 2 additions and 5 deletions

View File

@ -33,8 +33,7 @@ export default class Server {
if (routeFile === 'index.js') return;
try {
// eslint-disable-next-line new-cap
const route: Route = new (require(`${__dirname}/routes/${routeFile}`).default)(this);
this.client.signale.debug(route);
const route = new (require(`${__dirname}/routes/${routeFile}`).default)(this);
route.bind();
this.routes.set(route.conf.path, route);
this.app.use(route.conf.path, route.router);

View File

@ -11,9 +11,7 @@ export default class Route {
constructor(server: Server, conf: { path: string, deprecated?: boolean }) {
this.server = server;
this.router = router();
this.conf.path = conf.path;
if (conf.deprecated === undefined) this.conf.deprecated = false;
else this.conf.deprecated = conf.deprecated;
this.conf = conf;
}
public bind() {}