Arundathi Patil | 85db5b0 | 2019-01-17 14:10:08 +0530 | [diff] [blame] | 1 | /* |
| 2 | ============LICENSE_START========================================== |
| 3 | =================================================================== |
| 4 | Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved. |
| 5 | =================================================================== |
| 6 | |
| 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 |
| 11 | |
| 12 | http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | |
| 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============================================ |
| 20 | */ |
| 21 | |
Arundathi Patil | 85db5b0 | 2019-01-17 14:10:08 +0530 | [diff] [blame] | 22 | import { ApplicationConfig } from '@loopback/core'; |
Rami | 1741102 | 2019-05-27 17:23:37 +0200 | [diff] [blame] | 23 | import { CdsUiServerApplication } from './application'; |
| 24 | import { logger } from './logger/logger'; |
Arundathi Patil | 85db5b0 | 2019-01-17 14:10:08 +0530 | [diff] [blame] | 25 | export { CdsUiServerApplication }; |
| 26 | |
| 27 | export 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; |
Rami | 1741102 | 2019-05-27 17:23:37 +0200 | [diff] [blame] | 33 | logger.info(`Server is running at ${url}`); |
| 34 | logger.info(`Try ${url}/ping`); |
Arundathi Patil | 85db5b0 | 2019-01-17 14:10:08 +0530 | [diff] [blame] | 35 | |
| 36 | return app; |
| 37 | } |