Code Monkey home page Code Monkey logo

zpl-rest's People

Contributors

dependabot[bot] avatar kyc3 avatar mrothenbuecher avatar newaeonweb avatar rafaelncarvalho avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zpl-rest's Issues

Timeout causes server to crash

Hey @mrothenbuecher,

first of all, awesome work here! Helped me a lot in my project :)

By accident I found a little issue when my printer was not reachable. I called the /rest/print endpoint, which correctly responded with failure: true. After a little more time, the server then crashed with these logs

Mon May 01 2023 13:46:05 GMT+0200 (Central European Summer Time) Error: connect ETIMEDOUT 192.168.1.22:9100
node:_http_outgoing:644
    throw new ERR_HTTP_HEADERS_SENT('set');
    ^

Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client

I looked into it and nailed it down to the client.on('error', ...) handler, which was called a long time after the timeout handler was called. The callback then calls res.send which causes this error because the response was already sent.
However, I fixed it locally by making this small change here:

client.setTimeout(5000, function() {
    console.error((new Date()) + " " + "connection timed out");
    job.failed = true;
    job.error = "connection timed out";
    callback(job);
    client.destroy(); // was client.end() previously
  });

Basically by destroying the client, it is ensured that the other callbacks are not called anymore. Do you want me to submit a pull request?

Saltcorn pack or plugin request

Hello,
First of all, thanks for all your work on this project. It was almost exactly what I was looking for and I'm looking forward to implement it in my system.
I am using Saltcorn low code application builder to create a project, and it looks to me that you might have used Saltcorn, or at least Saltcorn's theme to create your project. It would be extremely helpful to me to be able to integrate your project into mine rather than having two separate apps running at once. Do you have a plugin or a pack for me to upload into my Saltcorn project with the code/tables/views needed for ZPL rest?
Thanks again.

Special Characters

Hey There!

Really excited about using this! It seems to be EXACTLY what we need and is making this process so much easier. However, one thing we are having issues with is special characters. When added directly to the template they print just fine. However, when contained in the json they seem to be getting reformatted before being applied via mustache. I'm trying to find where this might happen in the code, but im not really a Node pro.

Any ideas on how to fix?

Print label multiple times

Hello,

I plan to use this project in our company as middleware between our CMS and the printer.

We need to print a label multiple times (30-50) in a row. I didn't find an option to define the print quantity.

Am I blind or is there no such option? What is the best approach here?

QrCode

How can I implement QrCode????

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.