Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const axios = require('axios')
- const client = axios.create({
- baseURL: 'https://api.github.com/',
- responseType: 'json',
- headers: {
- 'Accept': 'application/vnd.github.v3+json application/vnd.github.inertia-preview+json', //create new project
- 'Accept': 'application/vnd.github.inertia-preview+json', //teams
- 'Accept': 'application/vnd.github.nebula-preview+json', //repos
- 'Authorization': 'token 491f783188ad31909826972fd2ec40bd41277ceb'
- }
- });
- // client.post('/orgs/ACME-3818/projects', {
- // "name": "test project ACME-3818"
- // })
- // client.get('orgs/ACME-3818/projects')
- // .then(function (response) {
- // console.log(response);
- // })
- // .catch(function (error) {
- // console.log(error);
- // });
- // client.post('orgs/ACME-3818/teams', {
- // "name": "frontend-developers"
- // });
- client.post('orgs/ACME-3818/repos',{
- name: "backend",
- team_id: "backend-developers"
- })
- .then(function(response){
- console.log(response);
- })
- .catch(function(response){
- console.log(response)
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement