Giter VIP home page Giter VIP logo

console-log-server's Issues

Script crashes when submitting a POST request

This is just the tool I've been looking for, thanks! I've been trying to find a way to debug outgoing API calls from my web app, and this looks really helpful.

Unfortunately the console-log-server keeps crashing when I send it a POST request using curl (either via command line or PHP-curl). Example:

curl --data "test=1" localhost:3000

Here is the crash message. Do you have any idea about what might be causing this? It seems to be that the script cannot correctly determine the bodyType and so it throws an exception.

I installed the app from npm, if that makes a difference.

console-log-server listening on http://localhost:3000

*************************
POST /
headers:
  host:           localhost:3000
  user-agent:     curl/7.47.0
  accept:         */*
  content-length: 10
  content-type:   application/x-www-form-urlencoded
query: (empty)
C:\Dev\____\node_modules\console-log-server\dist\logging.js:94
      throw new Error('Internal Error! bodyType not set!');
      ^

Error: Internal Error! bodyType not set!
    at exports.default (C:\Dev\______\node_modules\console-log-server\dist\logging.js:94:13)
    at ServerResponse.<anonymous> (C:\Dev\______\node_modules\console-log-server\dist\router.js:79:29)
    at emitNone (events.js:91:20)
    at ServerResponse.emit (events.js:185:7)
    at finish (_http_outgoing.js:593:10)
    at afterWrite (_stream_writable.js:388:3)
    at _combinedTickCallback (internal/process/next_tick.js:80:20)
    at process._tickCallback (internal/process/next_tick.js:98:9)

Does not work on Node 0.x

Logger uses String.repeat but it does not exist on Node 0.x and the server crashes:

node_modules/console-log-server/dist/logging.js:29
        var divLine = color('*'.repeat(text.length));
                                ^
    TypeError: undefined is not a function
        at divider (/home/vesse/temp/jarkkuli/node_modules/console-log-server/dist/logging.js:29:29)
        at exports.default (/home/vesse/temp/jarkkuli/node_modules/console-log-server/dist/logging.js:43:20)
        at ServerResponse.<anonymous> (/home/vesse/temp/jarkkuli/node_modules/console-log-server/dist/router.js:79:29)
        at ServerResponse.emit (events.js:104:17)
        at finish (_http_outgoing.js:551:10)
        at afterWrite (_stream_writable.js:361:3)
        at _stream_writable.js:349:9
        at process._tickCallback (node.js:355:11)

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.