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1B,EAAI,SAAS,UAAY,cAC1B,IAEA,IAAI,IAAI,cAAc,SAAS,EAAK,GACnC,EAAI,SAAS,UAAY,QAAS,EAAI,OAAO,KAC9C","file":"/npm/fey@0.1.6/app.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/fey@0.1.6/app.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","var express = require('express');\r\nvar app = express();\r\nvar fs = require('fs');\r\n\r\nvar path = process.cwd();\r\n\r\nvar cfg = {\r\n\tsrc :\"\",\r\n\tdist:\"\",\r\n\tdebug:\"\",\r\n\trc:\"\"\r\n};\r\n\r\n\r\nvar http = require('http').Server(app);\r\nvar io = require('socket.io')(http);\r\nvar fsm = require('./fsmanager.js');\r\nfsm.init(io);\r\n\r\n\r\nhttp.listen(3000, function(){\r\n\t//console.log(process.cwd());\r\n\tconsole.log('Fey is running on *:3000');\r\n});\r\n\r\nio.on('connection', function(socket){\r\n  //console.log('a user connected');\r\n  \r\n  var compile = 0;\r\n  var release = 0;\r\n  watchers = fsm.watcher();\r\n\tif(watchers.compile.length>0)\r\n\t\tcompile = 1;\r\n\tif(watchers.release.length>0)\r\n\t\trelease = 1;\r\n\t\r\n  socket.emit('notice', {type:'status',data:{compile:compile,release:release},cfg:cfg});\r\n  \r\n  \r\n  socket.on('disconnect', function(){\r\n    //console.log('user disconnected');\r\n  });\r\n  \r\n  socket.on('function',function(msg){\r\n\t\r\n\tswitch(msg.type){\r\n\t\tcase \"watch\":\t\t\t\r\n\t\t\tcfg.src = msg.data.src;\r\n\t\t\tcfg.dist = msg.data.dist;\r\n\t\t\twatchers = fsm.watcher();\r\n\t\t\tif(watchers.compile.length>0)\r\n\t\t\t\tfsm.unwatch();\r\n\t\t\telse\r\n\t\t\t\tfsm.watch(cfg);\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase \"unwatch\":\r\n\t\t\tfsm.unwatch();\r\n\t\tbreak;\r\n\t\tcase \"unwatchRelease\":\r\n\t\t\tfsm.unwatchRelease();\r\n\t\tbreak;\r\n\t\tcase \"watchRelease\":\t\t\t\r\n\t\t\tcfg.rc = msg.data.rc;\r\n\t\t\tcfg.debug = msg.data.debug;\r\n\t\t\twatchers = fsm.watcher();\r\n\t\t\tif(watchers.release.length>0)\r\n\t\t\t\tfsm.unwatchRelease();\r\n\t\t\telse\r\n\t\t\t\tfsm.watchRelease(cfg);\r\n\t\tbreak;\r\n\t\tcase \"release\":\r\n\t\t\tcfg.rc = msg.data.rc;\r\n\t\t\tcfg.debug = msg.data.debug;\r\n\t\t\tfsm.release(cfg.debug,cfg.rc);\r\n\t\tbreak;\r\n\t}\r\n\t\r\n  });\r\n  \r\n});\r\n\r\n\r\n\r\napp.get('/', function(req, res){\r\n\tres.sendFile(__dirname + '/index.html');\r\n});\r\n\r\napp.get('/web/:file', function(req, res){\r\n\tres.sendFile(__dirname + '/web/'+ req.params.file);\r\n});\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"]}