How Add nodejs App to frappe & bench?

in development add line to Procfile

custom_app: /usr/bin/node apps/custom_app/custom_node.js

or,

In production add following to supervisor.conf

[program:frappe-bench-custom-app]
command=/usr/bin/node /home/revant/frappe-bench/apps/custom_app/custom_node.js
priority=4
autostart=true
autorestart=true
stdout_logfile=/home/revant/frappe-bench/logs/custom-app.log
stderr_logfile=/home/revant/frappe-bench/logs/custom-app.error.log
user=revant
directory=/home/revant/frappe-bench

[group:frappe-bench-extras]
programs=frappe-bench-custom-app

Refer this gist

Please share if there are any better ways to do this.

7 Likes