X-Git-Url: https://git.kengrimes.com/?p=henge%2Fkiak.git;a=blobdiff_plain;f=router.js;h=da32c9500491adfae47701752d381f7488fbf27d;hp=411c4886c3323ff3f28e9768ec3bbe79479905c8;hb=a8bdc6c150c4f3417b2f18a480552a4015c248b1;hpb=5ae8bb9adc37111641414da912600ea97d834874 diff --git a/router.js b/router.js index 411c488..da32c95 100644 --- a/router.js +++ b/router.js @@ -83,7 +83,11 @@ exports = { console.log(err) }) console.log(`HTTP${(conf.tls == undefined) ? '' : 'S'} ` + +<<<<<<< HEAD `Server Started on port ${conf.port}${this.httpdRoot ? +======= + `Server Started on port ${conf.port}${this.httpdRoot ? +>>>>>>> 3f5fce84645ec2c59aec0908807d1e9cb3e05e2d `, serving files from ${this.httpdRoot}`:''}`) }, @@ -127,7 +131,10 @@ exports = { let htArgv = request.url.slice(1).split('?') const routeName = htArgv[0].split('/')[0] let route = this.routes[routeName] +<<<<<<< HEAD console.log(`route is ${route}`) +======= +>>>>>>> 3f5fce84645ec2c59aec0908807d1e9cb3e05e2d /* If the route exists, check if we are a returning host or a new client */ if (route) { if (route.bind) { @@ -143,7 +150,10 @@ exports = { request.connection.remoteAddress)) this.serveHost(response, route, htArgv) else */ +<<<<<<< HEAD else { +======= +>>>>>>> 3f5fce84645ec2c59aec0908807d1e9cb3e05e2d this.serveClient(request, response, route) } } @@ -252,7 +262,11 @@ exports = { } }, +<<<<<<< HEAD /** @func +======= + /** @func +>>>>>>> 3f5fce84645ec2c59aec0908807d1e9cb3e05e2d * @summary Create a new route for a host * @desc makes a new route for the given route name * @arg {string} routeName - name of the new route @@ -287,14 +301,22 @@ exports = { }) route.pendingResponses.addResponse = function (key, response_p) { let responses = this.get(key) || [] +<<<<<<< HEAD responses.push(response_p) this.set(key, responses) +======= + this.set(key, responses.push(response_p)) +>>>>>>> 3f5fce84645ec2c59aec0908807d1e9cb3e05e2d } this.routes[routeName] = route this.serveHost(response, route, argv) }, +<<<<<<< HEAD /** @func +======= + /** @func +>>>>>>> 3f5fce84645ec2c59aec0908807d1e9cb3e05e2d * @summary Serve a route to an authorized http host * @desc services host application to the client, establishing a socket * @arg {http.ServerResponse} response - response object to use