comparison Sphinx/source/plugins/python/authorization-node-service.js @ 704:ba2403ebd4b7

moving python samples in separate files (3)
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 11 Jun 2021 10:24:08 +0200
parents
children
comparison
equal deleted inserted replaced
703:a589668768d7 704:ba2403ebd4b7
1 const http = require('http');
2
3 const requestListener = function(req, res) {
4 let body = '';
5 req.on('data', function(chunk) {
6 body += chunk;
7 });
8 req.on('end', function() {
9 console.log(JSON.parse(body));
10 var answer = {
11 'granted' : false // Forbid access
12 };
13 res.writeHead(200);
14 res.end(JSON.stringify(answer));
15 });
16 }
17
18 http.createServer(requestListener).listen(8000);