yumauri / gotenberg-js-client

A simple JS/TS client for interacting with a Gotenberg API
MIT License
110 stars 9 forks source link

ECONNECTREFUSED ERROR #44

Closed Zaka-Ullah closed 2 years ago

Zaka-Ullah commented 2 years ago

ECCENECT refused error ocurred on const toPDF = pipe(gotenberg('http://localhost:3000/forms/chromium'),convert,html,please)
toPDF('...').catch(error=>{console.log(error)})

yumauri commented 2 years ago

Hello! Did you actually launch Gotenberg instance on localhost, port 3000?

Zaka-Ullah commented 2 years ago

i am running my node Js application on port 3001 and my front end react on port 3006

On Wed, May 25, 2022, 10:59 AM Victor @.***> wrote:

Hello! Did you actually launch Gotenberg instance on localhost, port 3000?

— Reply to this email directly, view it on GitHub https://github.com/yumauri/gotenberg-js-client/issues/44#issuecomment-1136762105, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUXREYRE5CIB33ZJQMCUF63VLW6S3ANCNFSM5W3IVN5Q . You are receiving this because you authored the thread.Message ID: @.***>

yumauri commented 2 years ago

This library is a client for Gotenberg, and cannot be used without it. Gotenberg — is a completely separate software tool, and you need to run it as well. Check its webpage — https://gotenberg.dev/

Although this library is not fully compatible with latest Gotenberg version, there are ways to use it anyway. See https://github.com/yumauri/gotenberg-js-client/issues/32#issuecomment-981140727

Zaka-Ullah commented 2 years ago

i have install it on my express server with npm install gotenberg-js-client and import modules according to your latest documentation and error arise of ecconecrefused on port localhost:3000

yumauri commented 2 years ago

And also you need to run Gotenberg itself, on localhost, port 3000. Like this:

docker run --rm -p 3000:3000 thecodingmachine/gotenberg:6
Zaka-Ullah commented 2 years ago

thanks

Zaka-Ullah commented 2 years ago

pipe( gotenberg(''), // any string here, will be overridden convert, // it is save to remove this line, if you want office, adjust({ // manually adjust endpoint url: 'http://localhost:3500/forms/libreoffice/convert', }), please ) What about now for this url at what endpoint should we run our docker on either on localhost:3000 or localhost:3500

On Wed, May 25, 2022, 8:55 PM Victor @.***> wrote:

And also you need to run Gotenberg itself, on localhost, port 3000. Like this:

docker run --rm -p 3000:3000 thecodingmachine/gotenberg:6

— Reply to this email directly, view it on GitHub https://github.com/yumauri/gotenberg-js-client/issues/44#issuecomment-1137468524, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUXREYWSRSAFIYJ5HQ2LQ2TVLZENHANCNFSM5W3IVN5Q . You are receiving this because you authored the thread.Message ID: @.***>

yumauri commented 2 years ago

This is up to you and your environment setup.

If you run Gotenberg on port 3000 — use 3000 in connection string. If you run Gotenberg on other port — use this port in connection string accordingly. If you run Gotenberg on different machine — use this machine's IP address and port instead of localhost:×××× (and setup routing).

Note, if you use docker image thecodingmachine/gotenberg:6 (as I wrote you), you can follow README, this is image with Gotenberg version 6, and library is compatible with it.

If you use docker image gotenberg/gotenberg:7 (as written in latest documentation) — only in this case you should use workarounds from issue #32, for this is Gotenberg version 7.