Initial Commit

This commit is contained in:
Leoh 2021-10-08 10:23:06 +05:30
parent b2d4fecec3
commit 59cb8f1d70
7 changed files with 101 additions and 7 deletions

16
view/habiticaAPI.ts Normal file
View file

@ -0,0 +1,16 @@
// import fetch from "node-fetch";
export async function getTasks(username: string, credentials: string){
const url = "https://habitica.com/api/v3/tasks/user?type=todos"
const response = fetch(url, {
method: 'GET',
headers: {
"Content-Type": "application/json",
"x-client": username.concat("-testAPI"),
"x-api-user": username,
"x-api-key": credentials,
},
})
return (response)
}