biz9-react-remote
Version:
** Description
46 lines (45 loc) • 1.58 kB
JavaScript
/*
Copyright 2016 Certified CoderZ
Author: Brandon Poole Sr. (biz9framework@gmail.com)
License GNU General Public License v3.0
Description: BiZ9 Framework: React-Remote - Test
*/
// -- biz9 --
import {DateTime,Log,Num,Str,Obj,Response_Logic,Response_Field,Status_Type} from 'biz9-utility';
import {Remote_Logic,Remote} from './index.js';
// -- other --
import {Config,Project_Table,Project_Url} from "./constant.js";
import async from 'async';
/*
* DEFINE
* connect
*/
class Project_Logic {
static get_url = (app_id,host,url,param) => {
let _app_id_ = 'app_id';
if(!param){
param='';
}
var app_id_url="?"+_app_id_+"="+app_id;
return host+"/"+url+app_id_url + param;
};
}
//9_connect
test('connect', async () => {
console.log('CONNECT-START');
let response={};
let option = {};
let data = {};
let parent = {first_name:'first_name_apple',last_name:'last_name_cool'};
let form_data = {data:parent,table:Project_Table.BLANK,option:option};
Log.w('11_form_data',form_data);
const url = Project_Logic.get_url(Config.APP_ID,Config.URL,Project_Url.PING);
Log.w('11_url',url);
const [biz_response,biz_data] = await Remote.post(url,form_data);
response = biz_response;
data = biz_data;
Log.w('99_biz_response',response);
Log.w('99_biz_data',data);
console.log('CONNECT-SUCCESS');
console.log('CONNECT-DONE');
}, 99999);