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.
18 lines
375 B
18 lines
375 B
|
|
|
|
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};
|
|
}
|
|
}
|
|
|