change loading
parent
ceb2e54e99
commit
cc0416c67e
|
@ -33,8 +33,7 @@ export default class Server {
|
||||||
if (routeFile === 'index.js') return;
|
if (routeFile === 'index.js') return;
|
||||||
try {
|
try {
|
||||||
// eslint-disable-next-line new-cap
|
// eslint-disable-next-line new-cap
|
||||||
const route: Route = new (require(`${__dirname}/routes/${routeFile}`).default)(this);
|
const route = new (require(`${__dirname}/routes/${routeFile}`).default)(this);
|
||||||
this.client.signale.debug(route);
|
|
||||||
route.bind();
|
route.bind();
|
||||||
this.routes.set(route.conf.path, route);
|
this.routes.set(route.conf.path, route);
|
||||||
this.app.use(route.conf.path, route.router);
|
this.app.use(route.conf.path, route.router);
|
||||||
|
|
|
@ -11,9 +11,7 @@ export default class Route {
|
||||||
constructor(server: Server, conf: { path: string, deprecated?: boolean }) {
|
constructor(server: Server, conf: { path: string, deprecated?: boolean }) {
|
||||||
this.server = server;
|
this.server = server;
|
||||||
this.router = router();
|
this.router = router();
|
||||||
this.conf.path = conf.path;
|
this.conf = conf;
|
||||||
if (conf.deprecated === undefined) this.conf.deprecated = false;
|
|
||||||
else this.conf.deprecated = conf.deprecated;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bind() {}
|
public bind() {}
|
||||||
|
|
Loading…
Reference in New Issue