apigeetool-node icon indicating copy to clipboard operation
apigeetool-node copied to clipboard

deploynodeapp - remove requirement for main script in top-level directory

Open tmarrs opened this issue 10 years ago • 4 comments

Please remove the requirement for the main script to reside in the top-level directory. This is unnecessary, and it forces me to adopt your directory structure for my app. For example, when i use -m .src/app.js, I get the following error:

Error: Main script file ./src/app.js must be in the top level directory

Here's how I worked around the problem:

  • Use -m app.js
  • Do a soft link as follows: ln -s .src/app.js app.js

Then everything works properly.

I consider this to be a defect. I don't want to use Apigee's directory structure, nor do I want it to influence my directory structure. Please remove the requirement that the main script must reside in the top-level directory structure. It will work just fine.

tmarrs avatar Dec 30 '15 22:12 tmarrs

This is one that we'd have to address in Apigee Edge itself. It's come up in other cases as well and is worth fixing IMHO.

In your case, does your "package.json" specify the "main" file? In other words, will your app run if you just run "node ." in the directory where package.json resides?

Or do you have some "script" defined in package.json?

Or something else?

On Wed, Dec 30, 2015 at 5:37 PM, Tom Marrs [email protected] wrote:

Please remove the requirement for the main script to reside in the top-level directory This is unnecessary, and it forces me to adopt your directory structure for my app For example, when i use -m src/appjs, I get the following error:

Error: Main script file /src/appjs must be in the top level directory

Here's how I worked around the problem:

  • Use -m appjs
  • Do a soft link as follows: ln -s src/appjs appjs

Then everything works properly

I consider this to be a defect I don't want to use Apigee's directory structure, nor do I want it to influence my directory structure Please remove the requirement that the main script must reside in the top-level directory structure It will work just fine

— Reply to this email directly or view it on GitHub https://github.com/apigee/apigeetool-node/issues/32.

Greg Brail | apigee https://apigee.com/ | twitter @gbrail http://twitter.com/gbrail @apigee https://twitter.com/apigee

gbrail avatar Dec 31 '15 05:12 gbrail

Thanks for looking into this issue.

I don't have a script defined in package.json. I only specify the "main" file.

tmarrs avatar Dec 31 '15 16:12 tmarrs

I opened APIRT-2453 to track this, which requires changing the way that Edge launches Node apps.

gbrail avatar Jan 15 '16 19:01 gbrail

That sounds good. Thanks for opening up this issue with Edge.

tmarrs avatar Jan 16 '16 20:01 tmarrs