[setup][page.noauth.login] added API/WS instances + defined urls

This commit is contained in:
xdrm-brackets 2018-03-27 14:10:00 +02:00
parent 22130a4b0b
commit 778984239b
2 changed files with 6 additions and 5 deletions

View File

@ -107,10 +107,7 @@ gs.get.login.func.login = function(){
if( errors )
return false;
/* (3) Create API instance */
let api = new xhrcd('douscord-srv.xdrm.io');
/* (4) API bindings */
/* (3) API bindings */
api.onreceive = function(_response){
// manage error
@ -125,7 +122,7 @@ gs.get.login.func.login = function(){
api.onclose = function(){ return gs.get.router.push('register'); };
/* (5) API call */
/* (4) API call */
api.send({
path: 'POST /user/token',
http_token: encodeURI(`${username}:${password}`)

View File

@ -22,6 +22,10 @@ window.auth = new Authentication();
window.xhrcd = XHRClientDriver;
window.wscd = WebSocketClientDriver;
/* (4) ClientDriver instances */
window.api = new XHRClientDriver('api.douscord.xdrm.io');
window.ws = new WebSocketClientDriver('ws.douscord.xdrm.io');
/* (2) Global data