MAJOR: Updates for Authenticated Web UI and CLI #30
| @ -326,8 +326,15 @@ controllers.ssh = function (req, res, opts) { | |||||||
|   state.config.sshAuto = sshAuto; |   state.config.sshAuto = sshAuto; | ||||||
|   sshSuccess(); |   sshSuccess(); | ||||||
| }; | }; | ||||||
| function serveControlsHelper() { | 
 | ||||||
|   controlServer = http.createServer(function (req, res) { | var serveStatic = require('serve-static')(path.join(__dirname, '../lib/admin/')); | ||||||
|  | function handleRemoteClient(req, res) { | ||||||
|  |   if (/^\/(rpc|api)\//.test(req.url)) { | ||||||
|  |     return handleApi(req, res); | ||||||
|  |   } | ||||||
|  |   serveStatic(req, res, require('finalhandler')(req, res)); | ||||||
|  | } | ||||||
|  | function handleApi(req, res) { | ||||||
|   var opts = url.parse(req.url, true); |   var opts = url.parse(req.url, true); | ||||||
|   if (false && opts.query._body) { |   if (false && opts.query._body) { | ||||||
|     try { |     try { | ||||||
| @ -675,7 +682,9 @@ function serveControlsHelper() { | |||||||
|     } |     } | ||||||
|     route(); |     route(); | ||||||
|   }); |   }); | ||||||
|   }); | } | ||||||
|  | function serveControlsHelper() { | ||||||
|  |   controlServer = http.createServer(handleRemoteClient); | ||||||
| 
 | 
 | ||||||
|   if (fs.existsSync(state._ipc.path)) { |   if (fs.existsSync(state._ipc.path)) { | ||||||
|     fs.unlinkSync(state._ipc.path); |     fs.unlinkSync(state._ipc.path); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user