ringcentral-personal-chatbot
Version:
RingCentral personal chatbot framework
39 lines (30 loc) • 891 B
JavaScript
;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _index = require("./index");
var _initDb = _interopRequireDefault(require("./common/init-db"));
/**
* run bot file with path supplied from command line
*/
const {
SERVER_PORT,
SERVER_HOST,
SERVER_HOME = '/',
RINGCENTRAL_CHATBOT_SERVER
} = process.env;
var _default = ({
path
}) => {
console.log('-> bot config:', path);
const conf = require(path);
const app = (0, _index.createApp)(conf);
app.listen(SERVER_PORT, SERVER_HOST, () => {
console.log(`-> server running at: http://${SERVER_HOST}:${SERVER_PORT}${SERVER_HOME}`);
console.log(`-> app url: ${RINGCENTRAL_CHATBOT_SERVER}${SERVER_HOME}`);
(0, _initDb.default)();
});
};
exports.default = _default;