Cоздать Сервер
Нужно сделать запрос через POST и где if добавить ещё несколько запросов как запрос 12345 что бы выводило а всё остальное "неправильно" . Вот мой пример ::help: :help: :help:
const http = require('http'); port=8082 http.createServer( function(request, response){ response.writeHead(200, {'Content-Type': 'text/html'}); /* response.end('' + '<body>' + '<h1>Hello, World!</h1>' + '<ul>' + '<li>Not info</li>' + '</ul>' + '</body>'); */ if (request.url == '/12345') { console.log('123456') }else { console.log('не правильно написано') } let resp = ''; /* request.on('data', function(data) { resp += data.toString(); }); request.on('end', function() { console.log(resp); response.end(); }); */ //response.end(''+request); //console.log(request.rawHeaders); //console.log(request.method); //console.log(request.headers); // console.log(resp) }).listen(8082); console.log('Server running on 8082'); |
Да node js
|
Часовой пояс GMT +3, время: 17:48. |