Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It crashes when connet without tablename #2

Open
maxmenGMK opened this issue Sep 14, 2018 · 3 comments
Open

It crashes when connet without tablename #2

maxmenGMK opened this issue Sep 14, 2018 · 3 comments
Assignees

Comments

@maxmenGMK
Copy link

It works, but not as long.
When i go to http://192.168.50.44:8000/posts/1, i see correct output:
[{"id":1,"title":"testtitle","content":"Testcontent","created":"0000-00-00"}]
But when i go to http://192.168.50.44:8000/posts/, i cant see tablenames, i see just
[]
But when i go to http://192.168.50.44:8000, it crashes:
/mysql/lib/protocol/Parser.js:80
throw err; // Rethrow non-MySQL errors
^
TypeError: First argument must be a string or Buffer
at ServerResponse.end (_http_outgoing.js:739:13)
at Query. (/home/grimakon/apinode/js-crud-api/app.js:90:12)
at Query. (/home/grimakon/node_modules/mysql/lib/Connection.js:502:10)
at Query._callback (/home/grimakon/node_modules/mysql/lib/Connection.js:468:16)
at Query.Sequence.end (/home/grimakon/node_modules/mysql/lib/protocol/sequences/Sequence.js:83:24)
at Query.ErrorPacket (/home/grimakon/node_modules/mysql/lib/protocol/sequences/Query.js:90:8)
at Protocol._parsePacket (/home/grimakon/node_modules/mysql/lib/protocol/Protocol.js:278:23)
at Parser.write (/home/grimakon/node_modules/mysql/lib/protocol/Parser.js:76:12)
at Protocol.write (/home/grimakon/node_modules/mysql/lib/protocol/Protocol.js:38:16)
at Socket. (/home/grimakon/node_modules/mysql/lib/Connection.js:91:28)

@mevdschee
Copy link
Owner

when i go to http://192.168.50.44:8000/posts/

Can you try: http://192.168.50.44:8000/posts (without trailing slash)?

when you go to http://192.168.50.44:8000

The behavior is undefined for that case.

@mevdschee mevdschee self-assigned this Sep 16, 2018
@maxmenGMK
Copy link
Author

when i go to http://192.168.50.44:8000/posts/

Can you try: http://192.168.50.44:8000/posts (without trailing slash)?

when you go to http://192.168.50.44:8000

The behavior is undefined for that case.

The result is the same without trailing slash and with trailing slash - it show "[]".
When i go to go to http://192.168.50.44:8000 why it is crashes?

@maxmenGMK
Copy link
Author

when i go to http://192.168.50.44:8000/posts/

Can you try: http://192.168.50.44:8000/posts (without trailing slash)?

when you go to http://192.168.50.44:8000

The behavior is undefined for that case.

How i can to define the behavior in this case? Can you help me? I am new in coding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants