Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
server: Add v basic backend node server
- Loading branch information
1 parent
2801586
commit 5571968
Showing
5 changed files
with
443 additions
and
422 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import Koa from 'koa'; | ||
import {Server} from 'socket.io'; | ||
|
||
import {createServer} from 'http'; | ||
|
||
const app = new Koa(); | ||
const server = createServer(app.callback()); | ||
|
||
const wss = new Server(server); | ||
|
||
wss.of('/ingest').on('connection', socket => { | ||
socket.on('store-init', console.log); | ||
socket.on('store-update', console.log); | ||
}); | ||
|
||
console.log('here we gooo'); | ||
|
||
app.use(ctx => { | ||
ctx.body = 'Hello World'; | ||
}); | ||
|
||
server.listen(3000); |
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
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
Oops, something went wrong.
5571968
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: