Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

Commit

Permalink
feat(apps): Add Get and List Apps Methods
Browse files Browse the repository at this point in the history
  • Loading branch information
nprail committed Jul 25, 2018
1 parent 3b67fc5 commit ffc2ea9
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions lib/flyApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,27 @@ class Fly {
return this.createError(err)
}
}

async getApps () {
try {
const res = await this.axios.get('/')
return res.data.data
} catch (err) {
return this.createError(err)
}
}

async getApp (name) {
if (this.resourceType === 'sites') {
throw new Error('Getting a single site is not supported')
}
try {
const res = await this.axios.get(`/${name}`)
return res.data.data
} catch (err) {
return this.createError(err)
}
}
}

module.exports = Fly

0 comments on commit ffc2ea9

Please # to comment.