You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
763 B
27 lines
763 B
7 years ago
|
const axios = require('axios');
|
||
|
|
||
|
const {
|
||
|
token
|
||
|
} = require('./config')
|
||
|
|
||
|
const domainList = require('./lib/domains/list');
|
||
|
const domainCreate = require('./lib/domains/create');
|
||
|
const domainRetrieve = require('./lib/domains/retrieve');
|
||
|
const domainDelete = require('./lib/domains/deleteDomain');
|
||
|
|
||
|
const instance = axios.create({
|
||
|
baseURL: 'https://api.digitalocean.com/v2',
|
||
|
timeout: 10000,
|
||
|
headers: {
|
||
|
'Authorization': `Bearer ${token}`
|
||
|
}
|
||
|
});
|
||
|
|
||
|
const domain = {
|
||
|
List: (instance) => domainList(instance),
|
||
|
Create: (instance, domainObject) => domainCreate(instance, domainObject),
|
||
|
Retrieve: (instance, domainName) => domainRetrieve(instance, domainName),
|
||
|
Delete: (instance, domainName) => domainDelete(instance, domainName),
|
||
|
};
|
||
|
|
||
|
module.exports.domain = domain;
|