From 9c3d4abe8b6d0ac558805202d71aa04b92f950f6 Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Wed, 6 Jul 2022 23:40:47 +0200 Subject: [PATCH] test axios get --- web/index.html | 2 +- web/js/config.js | 1 + web/js/login.js | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 web/js/config.js create mode 100644 web/js/login.js diff --git a/web/index.html b/web/index.html index 319a5bb..c5a8d19 100644 --- a/web/index.html +++ b/web/index.html @@ -14,7 +14,7 @@ - + diff --git a/web/js/config.js b/web/js/config.js new file mode 100644 index 0000000..7ee7173 --- /dev/null +++ b/web/js/config.js @@ -0,0 +1 @@ +const instance = axios.create({ baseURL: 'http://localhost:8080/api'}); \ No newline at end of file diff --git a/web/js/login.js b/web/js/login.js new file mode 100644 index 0000000..93ab4c1 --- /dev/null +++ b/web/js/login.js @@ -0,0 +1 @@ +instance.get("token", { auth:{username:"peter93", password:"toto"}}).then(function(response) { console.log(response) }); \ No newline at end of file