DefinitelyTyped/types/loopback-boot/loopback-boot-tests.ts
Mohamed Hegazy e564537f7f Fix lint failures (#16329)
* fix lint failures

* Fix more lint failures

* Fix some more lint errors
2017-05-04 15:31:42 -07:00

29 lines
567 B
TypeScript

import * as loopback from 'loopback';
import * as boot from 'loopback-boot';
import * as cookieParser from 'cookie-parser';
class Server {
app: loopback.LoopBackApplication;
static boostrap(): Server {
return new Server();
}
constructor() {
this.app = loopback();
this.app.use(cookieParser());
this.config();
}
private config(): void {
boot(this.app, __dirname, (err: Error) => {
if (err) throw err;
// start the server if `$ node server.js`
if (require.main === module)
this.app.start();
});
}
}