UNPKG

@microsoft.azure/autorest.testserver

Version:
23 lines 854 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.stopCommand = void 0; const constants_1 = require("../../constants"); const logger_1 = require("../../logger"); const stopCommand = async ({ port }) => { logger_1.logger.info("Stopping server at port {port}", port); try { const url = `http://localhost:${port}${constants_1.AdminUrls.stop}`; const response = await fetch(url, { method: "POST", }); logger_1.logger.debug(`Call success: ${url} ${response.status}`); logger_1.logger.info(`Successfuly stopped server at port ${port}`); process.exit(0); } catch (e) { logger_1.logger.error("Error while trying to stop server", e); process.exit(-1); } }; exports.stopCommand = stopCommand; //# sourceMappingURL=stop-command.js.map