diff --git a/src/apps.js b/src/apps.js index 30c5a85f7..7cbb7145e 100644 --- a/src/apps.js +++ b/src/apps.js @@ -6,7 +6,6 @@ exports = module.exports = { hasAccessTo: hasAccessTo, get: get, - getBySubdomain: getBySubdomain, getByIpAddress: getByIpAddress, getAll: getAll, getAllByUser: getAllByUser, @@ -272,21 +271,6 @@ function get(appId, callback) { }); } -function getBySubdomain(subdomain, callback) { - assert.strictEqual(typeof subdomain, 'string'); - assert.strictEqual(typeof callback, 'function'); - - appdb.getBySubdomain(subdomain, function (error, app) { - if (error && error.reason === DatabaseError.NOT_FOUND) return callback(new AppsError(AppsError.NOT_FOUND, 'No such app')); - if (error) return callback(new AppsError(AppsError.INTERNAL_ERROR, error)); - - app.iconUrl = getIconUrlSync(app); - app.fqdn = app.altDomain || config.appFqdn(app.location); - - callback(null, app); - }); -} - function getByIpAddress(ip, callback) { assert.strictEqual(typeof ip, 'string'); assert.strictEqual(typeof callback, 'function'); diff --git a/src/test/apps-test.js b/src/test/apps-test.js index 3cae564d0..3d6f2b579 100644 --- a/src/test/apps-test.js +++ b/src/test/apps-test.js @@ -201,24 +201,6 @@ describe('Apps', function () { }); }); - it('cannot getBySubdomain', function (done) { - apps.getBySubdomain('moang', function (error, app) { - expect(error).to.be.ok(); - expect(error.reason).to.be(AppsError.NOT_FOUND); - done(); - }); - }); - - it('can getBySubdomain', function (done) { - apps.getBySubdomain(APP_0.location, function (error, app) { - expect(error).to.be(null); - expect(app).to.be.ok(); - expect(app.iconUrl).to.eql(null); - expect(app.fqdn).to.eql(APP_0.location + '-' + config.fqdn()); - done(); - }); - }); - it('can getAll', function (done) { apps.getAll(function (error, apps) { expect(error).to.be(null);