Search code examples
javascriptnode.jsstronglooppackage.json

How does "slc start" determine which js should be loaded?


I can not find any detail explain about which property of package.json it looks at.

Normal package.json which have a "main" entry: ... "main": "app.js", ... OK, it i "slc start" it will load app.js.

But if i remove the "main" entry from package.json (not delete the app.js file), the "slc start" still load app.js.

Why? how does slc determine which js should be loaded?


Solution

  • From "Running an App" (https://docs.strongloop.com/display/APIS/Running+an+app):

    The application must have one of the following in the root directory (where you're running Arc):

    • Main application script file named server.js, app.js, or index.js.
    • A package.json file with a main property specifying the main application script file.