Files
call-me/app/api/users/users.js
T

17 lines
389 B
JavaScript

'use strict';
const url = 'http://localhost:8000/api/v1/users';
const authorization = 'call_me_api_key_secret';
fetch(url, {
method: 'GET',
headers: {
Authorization: authorization,
'Content-Type': 'application/json',
},
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error('Error:', error));