prefer package.json.walnut to package.json.main

This commit is contained in:
AJ ONeal 2015-11-23 08:42:55 +00:00
parent 28198dda87
commit f70f3cb390
1 changed files with 3 additions and 0 deletions

View File

@ -142,6 +142,9 @@ function getApi(pkgConf, pkgDeps, route) {
try {
route._apipkg = require(path.join(pkgpath, 'package.json'));
route._apiname = route._apipkg.name;
if (route._apipkg.walnut) {
pkgpath += '/' + route.apipkg.walnut;
}
promise = require(pkgpath).create(pkgConf, pkgDeps, myApp);
} catch(e) {
reject(e);