test axios get

This commit is contained in:
Valentin CZERYBA 2022-07-06 23:40:47 +02:00
parent 6a73d830bf
commit 9c3d4abe8b
3 changed files with 3 additions and 1 deletions

View File

@ -14,7 +14,7 @@
<!-- Bootstrap core CSS --> <!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous"> <link href="css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<!-- Favicons --> <!-- Favicons -->
<link rel="apple-touch-icon" href="https://getbootstrap.com/docs/5.1/assets/img/favicons/apple-touch-icon.png" sizes="180x180"> <link rel="apple-touch-icon" href="https://getbootstrap.com/docs/5.1/assets/img/favicons/apple-touch-icon.png" sizes="180x180">
<link rel="icon" href="https://getbootstrap.com/docs/5.1/assets/img/favicons/favicon-32x32.png" sizes="32x32" type="image/png"> <link rel="icon" href="https://getbootstrap.com/docs/5.1/assets/img/favicons/favicon-32x32.png" sizes="32x32" type="image/png">

1
web/js/config.js Normal file
View File

@ -0,0 +1 @@
const instance = axios.create({ baseURL: 'http://localhost:8080/api'});

1
web/js/login.js Normal file
View File

@ -0,0 +1 @@
instance.get("token", { auth:{username:"peter93", password:"toto"}}).then(function(response) { console.log(response) });