Basic Idea
This commit is contained in:
parent
e80db3449a
commit
b1d622826f
@ -35,7 +35,7 @@ def init():
|
||||
print("starting up... ",)
|
||||
|
||||
def handle_request_get(requestName, requestType):
|
||||
return flask.make_response("{\"message\":Handled}", 200, {"Content-Type": "application/json"})
|
||||
return flask.make_response("{\"message\": \"%s\"}" % "message123123", 200, {"Content-Type": "application/json"})
|
||||
|
||||
def handle_request_set(requestName, requestType, requestData):
|
||||
pass
|
||||
|
||||
@ -22,14 +22,25 @@ fetch_GetList = (fetchURL) => response = fetch(fetchURL)
|
||||
return response.text();
|
||||
})
|
||||
|
||||
GetList = async (listType) => {
|
||||
if (listType == "Chyron") {
|
||||
encodedString = encodeURIComponent({
|
||||
|
||||
|
||||
myObj = {
|
||||
'request_name': "Chyron",
|
||||
'request_type': "list"
|
||||
})
|
||||
targetURL = 'http://127.0.0.1:5500/api/v1/user_client/get?' + encodedString
|
||||
var a = await fetch_GetList(targetURL);
|
||||
};
|
||||
params = "?request_name="+encodeURIComponent(myObj.request_name)+"&"+"request_type="+encodeURIComponent(myObj.request_type);
|
||||
url = "http://127.0.0.1:5500/api/v1/user_client/get"+params;
|
||||
|
||||
GetList = async (listType) => {
|
||||
if (listType == "Chyron") {
|
||||
chyronListRequestOBJ = {
|
||||
'request_name': "Chyron",
|
||||
'request_type': "list"
|
||||
}
|
||||
params = "?request_name="+encodeURIComponent(chyronListRequestOBJ.request_name)+"&"+"request_type="+encodeURIComponent(chyronListRequestOBJ.request_type);
|
||||
targetURL = "http://127.0.0.1:5500/api/v1/user_client/get"+params;
|
||||
console.log(targetURL)
|
||||
a = await fetch_GetList(targetURL);
|
||||
console.log(a);
|
||||
return a
|
||||
}
|
||||
@ -39,8 +50,10 @@ GetList = async (listType) => {
|
||||
}
|
||||
|
||||
async function GetListChyron() {
|
||||
var returnedList = await GetList("Chyron");
|
||||
|
||||
returnedList = await GetList("Chyron");
|
||||
obj = JSON.parse(returnedList);
|
||||
console.log(obj["message"])
|
||||
return returnedList
|
||||
}
|
||||
|
||||
GetListChyron();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user