-
Notifications
You must be signed in to change notification settings - Fork 0
/
application.js
34 lines (29 loc) · 1.01 KB
/
application.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
'use strict';
const path = require('path');
const {BootMixin} = require('@loopback/boot');
const {RepositoryMixin} = require('@loopback/repository');
const {RestApplication} = require('@loopback/rest');
const {ServiceMixin} = require('@loopback/service-proxy');
const restExplorer = require('@loopback/rest-explorer');
const MySequence = require('./sequence');
class Lb4Application extends BootMixin(ServiceMixin(RepositoryMixin(RestApplication))) {
constructor(options = {}) {
super(options);
this.route('get', '/hi', {responses: {}}, () => 'Hi!');
this.sequence(MySequence);
this.static('/', path.join(__dirname, '../public'));
this.bind(restExplorer.RestExplorerBindings.CONFIG).to({
path: '/explorer',
});
this.component(restExplorer.RestExplorerComponent);
this.projectRoot = __dirname;
this.bootOptions = {
controllers: {
dirs: ['controllers'],
extensions: ['.controller.js'],
nested: true,
},
};
}
}
module.exports = Lb4Application;