在服务器上初始化 socketstream 文件:“/app.js”
var http = require ( 'http' ) ;
var ss = require ( 'socketstream' ) ;
var server = http . Server ( ss . http . middleware ) ;
server . listen ( 8000 ) ;
ss . start ( server ) ;
路由文件:“/app.js”
ss . http . route ( '/' , function ( request , response ) {
console . log ( 'request for "/" received' ) ;
} ) ;
定义一个客户文件:“/app.js” view : 来自“/client/views”文件夹的 html
1