allow installing using version
This commit is contained in:
parent
eac6c8deab
commit
e33e78be82
13
cloudron.js
13
cloudron.js
@ -163,12 +163,21 @@ Cloudron.prototype.setCredentials = function (password, accessToken) {
|
||||
};
|
||||
};
|
||||
|
||||
Cloudron.prototype.installApp = function (location, manifest, portBindings) {
|
||||
Cloudron.prototype.installApp = function (location, manifestOrAppstoreId, portBindings) {
|
||||
portBindings = portBindings || null; // null binds nothing
|
||||
|
||||
var data = {
|
||||
manifest: typeof manifestOrAppstoreId === 'object' ? manifestOrAppstoreId : null,
|
||||
appStoreId: typeof manifestOrAppstoreId === 'string' ? manifestOrAppstoreId : null,
|
||||
location: location,
|
||||
accessRestriction: null,
|
||||
oauthProxy: false,
|
||||
portBindings: portBindings
|
||||
};
|
||||
|
||||
var res = request.post(this._origin + '/api/v1/apps/install')
|
||||
.query({ access_token: this._credentials.accessToken })
|
||||
.send({ manifest: manifest, appStoreId: '', location: location, accessRestriction: null, oauthProxy: false, portBindings: portBindings })
|
||||
.send(data)
|
||||
.end();
|
||||
common.verifyResponse2xx(res, 'Cannot install app');
|
||||
debug('App installed at %s'.green, location);
|
||||
|
Loading…
Reference in New Issue
Block a user