2 ============LICENSE_START==========================================
3 ===================================================================
4 Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
5 ===================================================================
7 Unless otherwise specified, all software contained herein is licensed
8 under the Apache License, Version 2.0 (the License);
9 you may not use this software except in compliance with the License.
10 You may obtain a copy of the License at
12 http://www.apache.org/licenses/LICENSE-2.0
14 Unless required by applicable law or agreed to in writing, software
15 distributed under the License is distributed on an "AS IS" BASIS,
16 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 See the License for the specific language governing permissions and
18 limitations under the License.
19 ============LICENSE_END============================================
22 import { BootMixin } from '@loopback/boot';
23 import { ApplicationConfig } from '@loopback/core';
26 RestExplorerComponent,
27 } from '@loopback/rest-explorer';
28 import { RepositoryMixin } from '@loopback/repository';
29 import { RestApplication } from '@loopback/rest';
30 import { ServiceMixin } from '@loopback/service-proxy';
31 import * as path from 'path';
32 import { MySequence } from './sequence';
34 export class CdsUiServerApplication extends BootMixin(
35 ServiceMixin(RepositoryMixin(RestApplication)),
37 constructor(options: ApplicationConfig = {}) {
40 // Set up the custom sequence
41 this.sequence(MySequence);
43 // Set up default home page
44 this.static('/', path.join(__dirname, '../../public'));
46 // Customize @loopback/rest-explorer configuration here
47 this.bind(RestExplorerBindings.CONFIG).to({
50 this.component(RestExplorerComponent);
52 this.projectRoot = __dirname;
53 // Customize @loopback/boot Booter Conventions here
56 // Customize ControllerBooter Conventions here
57 dirs: ['controllers'],
58 extensions: ['.controller.js'],