diff --git a/package.json b/package.json
index be34959..a8bd6e1 100644
--- a/package.json
+++ b/package.json
@@ -25,6 +25,7 @@
},
"type": "module",
"dependencies": {
- "@sveltejs/adapter-static": "^1.0.0-next.16"
+ "@sveltejs/adapter-static": "^1.0.0-next.16",
+ "axios": "^0.21.1"
}
}
diff --git a/src/lib/Apiclient.js b/src/lib/Apiclient.js
new file mode 100644
index 0000000..3f9b6ee
--- /dev/null
+++ b/src/lib/Apiclient.js
@@ -0,0 +1,18 @@
+import axios from 'axios';
+const config = {
+ username: "niggl",
+ password: "9VEBc596T7tiPB7mNJukfeH9LfGzrrJN"
+}
+export default class Apiclient {
+ static async getUrls() {
+ return (await axios.get("https://kauft.es/api?showVisits=true", {
+ auth: config
+ })).data
+ }
+
+ static async deleteUrl(shortcode) {
+ return (await axios.delete(`https://kauft.es/api/${shortcode}`, {
+ auth: config
+ })).status
+ }
+}
\ No newline at end of file
diff --git a/src/routes/links.svelte b/src/routes/links.svelte
index 6884949..e2356d4 100644
--- a/src/routes/links.svelte
+++ b/src/routes/links.svelte
@@ -1,46 +1,58 @@
Manage all links
-
-
-
-
- Shortcode
- |
-
- Target
- |
-
- Visits
- |
-
- Edit
- |
-
-
-
-
- TODO |
-
- https://sthsth
- |
- 69 |
-
- Delete
- |
-
-
-
+
+
+
+
+ Shortcode
+ |
+
+ Target
+ |
+
+ Visits
+ |
+
+ Edit
+ |
+
+
+
+ {#each urls as url}
+
+
+ {url.shortcode}
+ |
+
+ {url.target}
+ |
+ {url.visits} |
+
+
+ |
+
+ {/each}
+
+