-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement eslint, babel, and prettier, resolve issue #1
- Loading branch information
1 parent
aaf77db
commit cb1cc3d
Showing
8 changed files
with
4,742 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["@babel/preset-env"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module.exports = { | ||
'env': { | ||
'es6': true, | ||
'node': true | ||
}, | ||
'extends': 'standard', | ||
'globals': { | ||
'Atomics': 'readonly', | ||
'SharedArrayBuffer': 'readonly' | ||
}, | ||
'parserOptions': { | ||
'ecmaVersion': 2018, | ||
'sourceType': 'module' | ||
}, | ||
'rules': { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = { | ||
singleQuote: true, | ||
semi: false, | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
exports.info = { | ||
url: '/account/info', | ||
requestType: 'GET' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
exports.print = function() { | ||
console.log('Hello from Vultr!'); | ||
}; | ||
exports.initialize = apiKey => { | ||
const makeApiRequest = require('./util/make-api-request').makeApiRequest | ||
const account = require('./api/account') | ||
|
||
return { | ||
account: { | ||
info: () => { | ||
makeApiRequest(apiKey, account.info.requestType, account.info.url) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
exports.makeApiRequest = (apiKey, requestType, url) => { | ||
const request = require('request') | ||
const options = { | ||
method: requestType, | ||
url: `https://api.vultr.com/v1${url}`, | ||
headers: { | ||
'API-Key': apiKey | ||
} | ||
} | ||
|
||
request(options, function (error, response, body) { | ||
if (!error && response.statusCode === 200) { | ||
const responseInfo = JSON.parse(body) | ||
console.log(responseInfo) | ||
} | ||
}) | ||
} |