_initializeServer() {
+ const self = this;
+
this._app = Koa();
this._app.use(KoaBodyParser());
+ this._app.use(function * (next) {
+
+ const accountSid = this.request.body.AccountSid || this.request.query.AccountSid;
+
+ if (accountSid === self.twilioAccountSid) {
+ yield next;
+ }
+ else {
+ this.throw('Unauthorized', 401);
+ }
+ });
+
this._initializeMainMenuRoutes();
this._initializeRecordingMenuRoutes();
this._initializeRecordingsRoutes();