Skip to content

Instantly share code, notes, and snippets.

@emaildano
Created May 17, 2019 00:19
Show Gist options
  • Save emaildano/d851cfad3e462267d72d3514f720c6fc to your computer and use it in GitHub Desktop.
Save emaildano/d851cfad3e462267d72d3514f720c6fc to your computer and use it in GitHub Desktop.
"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