DefinitelyTyped/loopback-boot/loopback-boot-test.ts
Andres David Jimenez eab7e87d19 Loopback-boot (#13832)
* loopback-boot module typings

* loopback-boot module typings

* prepare test

* prepare test passed

* prepare tsconfig file

* prepare proyect link

* prepare proyect link

* re-testing
2017-01-07 12:03:19 -08:00

29 lines
626 B
TypeScript

/// <reference path="index.d.ts" />
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();
});
}
}