blob: 3afc0a7f42a3f77957bd80b17c6fd1852fd37a7b [file] [log] [blame]
Arundathi Patil85db5b02019-01-17 14:10:08 +05301/*
2============LICENSE_START==========================================
3===================================================================
4Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
5===================================================================
6
7Unless otherwise specified, all software contained herein is licensed
8under the Apache License, Version 2.0 (the License);
9you may not use this software except in compliance with the License.
10You may obtain a copy of the License at
11
12 http://www.apache.org/licenses/LICENSE-2.0
13
14Unless required by applicable law or agreed to in writing, software
15distributed under the License is distributed on an "AS IS" BASIS,
16WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17See the License for the specific language governing permissions and
18limitations under the License.
19============LICENSE_END============================================
20*/
21
Arundathi Patil85db5b02019-01-17 14:10:08 +053022import { ApplicationConfig } from '@loopback/core';
Rami17411022019-05-27 17:23:37 +020023import { CdsUiServerApplication } from './application';
24import { logger } from './logger/logger';
Arundathi Patil85db5b02019-01-17 14:10:08 +053025export { CdsUiServerApplication };
26
27export async function main(options: ApplicationConfig = {}) {
28 const app = new CdsUiServerApplication(options);
29 await app.boot();
30 await app.start();
31
32 const url = app.restServer.url;
Rami17411022019-05-27 17:23:37 +020033 logger.info(`Server is running at ${url}`);
34 logger.info(`Try ${url}/ping`);
Arundathi Patil85db5b02019-01-17 14:10:08 +053035
36 return app;
37}