Get registry (if it's set) from config.json in suggest method (client-side)

This commit is contained in:
Andrea Cardinale
2015-09-30 10:32:25 +02:00
parent 70b7535a27
commit d7a0adc5c8
2 changed files with 2 additions and 1 deletions

View File

@@ -213,7 +213,7 @@ define('admin/extend/plugins', function() {
Plugins.suggest = function(pluginId, callback) {
var nbbVersion = app.config.version.match(/^\d\.\d\.\d/);
$.ajax('https://packages.nodebb.org/api/v1/suggest', {
$.ajax((app.config.registry ? app.config.registry : 'https://packages.nodebb.org')+'/api/v1/suggest', {
type: 'GET',
data: {
package: pluginId,

View File

@@ -32,6 +32,7 @@ module.exports = function(Meta) {
db.getObject('config', function (err, config) {
config = config || {};
config.version = nconf.get('version');
config.registry = nconf.get('registry');
callback(err, config);
});
};