Created
May 17, 2019 00:19
-
-
Save emaildano/d851cfad3e462267d72d3514f720c6fc to your computer and use it in GitHub Desktop.
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
"use strict"; | |
module.exports.run = () => { | |
const axios = require("axios"); | |
axios | |
.post("https://api.getshifter.io/v1/login", { | |
username: process.env.USERNAME, | |
password: `${process.env.PASSWORD}` | |
}) | |
.then(res => { | |
console.log(res.data.AccessToken); | |
axios.defaults.headers.common.Authorization = res.data.AccessToken; | |
axios.post( | |
`https://api.getshifter.io/v1/projects/${process.env.SITE_ID}/artifacts` | |
); | |
}) | |
.catch(error => { | |
console.error(error); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment