You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
375 B
19 lines
375 B
1 month ago
|
|
||
|
|
||
|
const API_SERVER = "http://localhost:1234/API";
|
||
|
|
||
|
|
||
|
async function API_GET(target) {
|
||
|
try {
|
||
|
const response = await fetch(API_SERVER + target, {
|
||
|
method: 'GET',
|
||
|
headers: {
|
||
|
},
|
||
|
credentials: 'include',
|
||
|
});
|
||
|
return await response.text();
|
||
|
} catch (error) {
|
||
|
return {error: error.message};
|
||
|
}
|
||
|
}
|