mirror of
https://github.com/grafana/grafana.git
synced 2024-11-28 11:44:26 -06:00
1d689888b0
* Updated package json but not updated source files * Update eslint plugin * updated files
31 lines
530 B
TypeScript
31 lines
530 B
TypeScript
const axios = require('axios');
|
|
|
|
export function getClient(options) {
|
|
return axios.create({
|
|
baseURL: 'http://localhost:3000',
|
|
timeout: 1000,
|
|
auth: {
|
|
username: options.username,
|
|
password: options.password,
|
|
},
|
|
});
|
|
}
|
|
|
|
export function getAdminClient() {
|
|
return getClient({
|
|
username: 'admin',
|
|
password: 'admin',
|
|
});
|
|
}
|
|
|
|
let client = getAdminClient();
|
|
|
|
client.callAs = function (user) {
|
|
return getClient({
|
|
username: user.login,
|
|
password: 'password',
|
|
});
|
|
};
|
|
|
|
export default client;
|