Try ERPNext Buy Support Partners Foundation

How Add nodejs App to frappe & bench?

I need to add nodejs app to use barcode API:

I can run it on port 3030 but I want it to be integrated to the framework while start the erpnext by default .

What the steps are needed to that?

Mohammed Redha

Any help please?

@Mohammed_Redha i dont know how its done but this would be the best example i have seen. https://github.com/mxmo-co/bpmn_editor

Thanks for your reply but this is not what I am looking for.
I want to run nodejs server to consume API call.

How to start nodejs server when bench start?

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.

3 Likes

Hi @Mohammed_Redha,

Sure, I’ll check and get back to you if i find any issue or find better way.

Thanks.