UNPKG

@authup/server-api

Version:

This is a standalone application.

47 lines 1.44 kB
"use strict"; /* * Copyright (c) 2021-2022. * Author Peter Placzek (tada5hi) * For the full copyright and license information, * view the LICENSE file that was distributed with this source code. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.StartCommand = void 0; const core_1 = require("../../core"); const commands_1 = require("../../commands"); const config_1 = require("../../config"); const database_1 = require("../../database"); class StartCommand { constructor() { this.command = 'start'; this.describe = 'Start the server.'; } builder(args) { return args .option('root', { alias: 'r', default: process.cwd(), describe: 'Path to the project root directory.', }); } async handler(args) { const config = await (0, config_1.setupConfig)(); const dataSourceOptions = await (0, database_1.buildDataSourceOptions)(); const logger = (0, core_1.createLogger)({ directory: config.get('writableDirectoryPath'), env: config.get('env'), }); try { await (0, commands_1.startCommand)({ logger, dataSourceOptions, }); } catch (e) { logger.error(e); process.exit(1); } } } exports.StartCommand = StartCommand; //# sourceMappingURL=start.js.map