crypto-compare | A cryptocurrency live pricing data displaying app | Frontend Framework library
kandi X-RAY | crypto-compare Summary
kandi X-RAY | crypto-compare Summary
A cryptocurrency live pricing data displaying app, which is built with Next.js
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of crypto-compare
crypto-compare Key Features
crypto-compare Examples and Code Snippets
Community Discussions
Trending Discussions on crypto-compare
QUESTION
I am trying to connect to the crypto compare
's api websockets to get the up to date prices for crypto currencies. I am using expressjs
for my server and socketio
to connect to crypto compare
.
However after logging connected
nothing else seems to happen.
This is my first time trying to play with sockets so I am a little lost as to why the io.emit
function is not triggering anything.
Also there seems to be an issue in the callback of connect
as socket
is undefined!
Why does emit
not seem to be doing anything?
My app.js file:
...ANSWER
Answered 2018-Jan-23 at 01:39The code you are using is client side code. This code does not return a socket in the callback because the client already knows the socket its connected with.
You are subscribing to a socket service, but you do not have any code that responds to data sent from that service.
When crypto compare returns data it sends the "m" event. So you need to respond to "m".
An example
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install crypto-compare
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page