-
-
Save wyqydsyq/dba18eef9ea06b06a108fc6f6ed2f803 to your computer and use it in GitHub Desktop.
koa-ws.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as Koa from 'koa' | |
import * as KoaWebsocket from 'koa-websocket' | |
import uuid from 'uuid/v4' | |
const app = KoaWebsocket(new Koa()) | |
app.ws.use(function(ctx) { | |
console.log('1') | |
const id = uuid() | |
console.log('2') // never logs | |
}) | |
app.listen(config.port) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment