DefinitelyTyped/types/loopback-boot/loopback-boot-tests.ts
Andy b6c343f2b3 Apply new lint rules to yet more packages (#15548)
* Apply new lint rules to yet more packages

* Fix leaflet lint
2017-03-31 11:01:26 -07:00

29 lines
591 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();
});
}
}