Upgrade to Pro — share decks privately, control downloads, hide ads and more …

LoopBackを使った極初歩的なAPIとSwiftで作るオシャレアプリ__.pdf

moomoo-ya
July 02, 2015
66

 LoopBackを使った極初歩的なAPIとSwiftで作るオシャレアプリ__.pdf

moomoo-ya

July 02, 2015
Tweet

More Decks by moomoo-ya

Transcript

  1. /server/boot/sio.js module.exports = function(app) { //server.jsͰapp.emit(‘started’)ͯ͠Δ app.on('started', function() { !

    //app.server͸app.listen()ͷฦΓ஋ೖΕ͓ͯ͘ app.io = require(‘socket.io').listen(app.server) ! //ద౰ͳσΟϨΫτϦͷindex.jsʹapp,app.ioΛ౉͢ //Α͘ݟͨΒapp͚ͩͰ͍͍Μ͡Ό……orz require('../sio/')(app, app.io); }); }
  2. /server/sio/index.js module.exports = function(app, io) { io.on('connection', function(socket) { console.log('connect...');

    socket.on('disconnect', function() { console.log('disconnect...'); }); }); ! //100msec.ִؒͰemit()͍ͨ͠ͱ͖͸͜Μͳײ͡ setInterval(function(){ io.emit(‘hogehoge’); }, 100); }