Node.js server that accepts POST requests

The following code shows how to read values from an HTML form. As @pimvdb said you need to use the request.on(‘data’…) to capture the contents of the body. const http = require(‘http’) const server = http.createServer(function(request, response) { console.dir(request.param) if (request.method == ‘POST’) { console.log(‘POST’) var body = ” request.on(‘data’, function(data) { body += data … Read more

How to restart kubernetes nodes?

Get nodes kubectl get nodes Result: NAME STATUS AGE 192.168.1.157 NotReady 42d 192.168.1.158 Ready 42d 192.168.1.159 Ready 42d Describe node Here is a NotReady on the node of 192.168.1.157. Then debugging this notready node, and you can read offical documents – Application Introspection and Debugging. kubectl describe node 192.168.1.157 Partial Result: Conditions: Type Status LastHeartbeatTime … Read more

Why is NULL undeclared?

NULL is not a built-in constant in the C or C++ languages. In fact, in C++ it’s more or less obsolete, just use a plain literal 0 instead, the compiler will do the right thing depending on the context. In newer C++ (C++11 and higher), use nullptr (as pointed out in a comment, thanks). Otherwise, … Read more