jamonkko / console-log-server Goto Github PK
View Code? Open in Web Editor NEWPrettyprints all requests to your command line console
License: MIT License
Prettyprints all requests to your command line console
License: MIT License
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)
cli.js
depends on lodash/fp
, but it's not listed in dependencies
.
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)
It would be useful if one could configure the server to wait for specified amount of time before sending the response.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.