example doesn't work
See original GitHub issueconst koa = require('koa');
const websockify = require('koa-websocket');
const router = require('koa-router');
const app = new koa();
const api = router();
const socket = websockify(app);
api.get('/*', function* (next) {
this.websocket.send('Hello World');
this.websocket.on('message', function(message) {
console.log(message);
});
});
app.ws.use(api.routes()).use(api.allowedMethods());
app.listen(3000);
When I try to debug with wscat -c ws://localhost:3000
nothing happens 😦
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:8 (1 by maintainers)
Top Results From Across the Web
I don't know why this three.js example doesn't work
I'm currently using VS-Code & have two files : index.html and index.js By copying a simple example from threejs.org I can't seem to...
Read more >Nextjs example SSR doesnt work. · Issue #1735 - GitHub
In the nextjs-supabase-auth example the SSR functionality doesn't work. I can't get it to work either. In the API where the cookie is...
Read more >What to do if the code doesn't work? - GeeksforGeeks
This article will discuss the different routes one could take if their code fails to work in various scenarios.
Read more >Troubleshooting and tips — Numba 0.50.1 documentation
When Numba tries to compile your code it first tries to work out the types of all the ... respectively, and doesn't know...
Read more >Beginning example doesn't work - Get Help - Vue Forum
Why doesn't the beginner example on the site that is in JSFiddle work?
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
koa-router
is not explicitly supported, but patches with tests are welcome.same here. i searched and saw some discussion about this. any update?