Skip to content

Commit

Permalink
fix(glitch.js): fix param
Browse files Browse the repository at this point in the history
  • Loading branch information
sotayamashita committed Jun 17, 2018
1 parent 2eef5cf commit 4b3e81d
Show file tree
Hide file tree
Showing 5 changed files with 3,970 additions and 2,598 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ notifications:

node_js:
- '8'
- '9'
- '10'

before_install:
- npm install -g npm@5
Expand All @@ -30,4 +32,4 @@ after_success:
branches:
only:
- master
- /^greenkeeper/.*$/
- /^greenkeeper/.*$/
22 changes: 13 additions & 9 deletions lib/glitch.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
const r2 = require('r2')
const queryString = require('query-string')
const r2 = require("r2");
const queryString = require("query-string");

class Glitch {
constructor (token) {
this.endpoint = 'https://api.glitch.com'
this.token = token
constructor(token) {
this.endpoint = "https://api.glitch.com";
this.token = token;
}

async importFromGithub (projectId, repo) {
const query = queryString.stringify({ token: this.token, projectId: projectId, repo: repo })
return r2.post(`${this.endpoint}/project/githubImport?${query}`).response
async importFromGithub(projectId, repo) {
const query = queryString.stringify({
authorization: this.token,
projectId: projectId,
repo: repo
});
return r2.post(`${this.endpoint}/project/githubImport?${query}`).response;
}
}

module.exports = Glitch
module.exports = Glitch;
Loading

0 comments on commit 4b3e81d

Please sign in to comment.