Ionic as service - ubuntu


I need the ionic working like a service. This I need for the test environment. I need get PID to control the ionic. Does exist a solution for?

I am wrapping into the supervisor.

vagrant@ubuntu-14:~$ sudo cat /etc/supervisor/conf.d/ionic-car_budget.conf 
command=ionic serve --port=8001 --address=

Cordova, ionic are installed globally. I run IONIC from console successfully.
Supervisor can not start it.
It seems, some environment variables are missed.

TypeError: Arguments to path.join must be strings
    at path.js:360:15
    at Array.filter (native)
    at Object.exports.join (path.js:358:36)
    at Object.<anonymous> (/usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/ionic-cordova-lib/src/cordova/util.js:34:31)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)

        throw new TypeError('Arguments to path.join must be strings');

Thank you.

Why do you want to run ionic serve as a service? If you simply want to serve your app as a static website just serve its www folder in any regular HTTP server like Apache or Nginx.

I am creating a box for testers IONIC and Flask. Than We will create PhantomJS tests. These tests Backend and front-end together. Simple QAs will write tests.

I’ve found similar solution in the network. I cues are here.

The point is that the web part of an Ionic app is just a bunch of static HTML, CSS, and JavaScript files that you can serve using any HTTP server. So it’s not necessary to use ionic serve, you can use any HTTP server.

ionic serve is useful for development because it provides live reload etc., but I don’t think you want livereload when running end-to-end tests.

:smiley: Yes, you are right! For tests it is enough.

For translators we still need a live reload.

Thank you.