Skip to content

Latest commit

 

History

History
26 lines (13 loc) · 1.47 KB

persistentapps.md

File metadata and controls

26 lines (13 loc) · 1.47 KB

Persistent apps

The contents of a domains folder can now be a Node.js app. We do this by integrating the Forever app, as a Node package. It does all the app management.

Overview

As PagePark starts up, it looks in each of the sub-folders of the domains folder.

If a folder contains a package.json file and a node_modules folder, it then looks for a main property at the top level of the package.json file and that's the file it launches with Forever. If the main property is not present, it scans the folder and launches the first file it finds that ends in .js.

Details

  1. You can set any of the options for Forever with a forever object at the top level of your config.json file.

  2. Your app has a log file in the data sub-folder of the folder PagePark is running from.

  3. You have to enable persistent apps globally by setting PagePark's config.flRunPersistentScripts to true. Unless you do so it will not look in the domains folder at startup.

Limits, unfinished business

  1. You can launch an app after PagePark boots, through the command-line app, pp rescan.

  2. It should be possible to disable an app even if it has a package.json file and a node_modules folder. Probably something in its config.json file.

  3. flRunPersistentScripts should be called flRunPersistentApps.