As an asynchronous event-driven JavaScript runtime, Node.js is designed to build scalable network applications. In Node.js, many connections can be handled concurrently. Upon each connection, the callback is fired, but if there is no work to be done, Node.js will sleep.
HTTP is a first-class citizen in Node.js, designed with streaming and low latency in mind. This makes Node.js well-suited for the foundation of a web library or framework.
The following defines the requirements to run the Node.js module in the Section platform:
process.env.PORT
for HTTP/1.1 — never using HTTPS or any other port.next-hop:80
as HTTP, never HTTPS.
next-hop
resolves to the next proxy in the chain or the origin — whichever is next upstream.X-Forwarded-Proto: https
HTTP request header to perform HTTPS requests to the origin./var/log/nodejs
directory..gitignore
file which ignores the node_modules
directory.package-lock.json
file which is generated by npm
.X-Forwarded-Proto: https
request header for HTTPS connections from the browser. Assume HTTP otherwise.True-Client-IP
request header containing the IP address of the client connecting to the Section servers. The X-Forwarded-For
request header will be also be present but may contain multiple IP addresses from other HTTP proxies between the client and the Node.js module.