Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
litespeed_wiki:cloudlinux:node.js_selector [2018/05/22 13:12] Tihomir |
litespeed_wiki:cloudlinux:node.js_selector [2023/03/25 13:38] Lisa Clarke Redirect to new Documentation Site |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | === Installation === | + | ~~REDIRECT>https://docs.litespeedtech.com/lsws/cp/cpanel/cloudlinux/#rubypythonnodejs-selector~~ |
- | + | ||
- | NodeJS Selector from Cloudlinux is supported by Litespeed Webserver out of the box. You will need only to setup correctly the selector. You can use official cloudlinux on this [[https://docs.cloudlinux.com/index.html?nodejs_selector.html|address]]. | + | |
- | + | ||
- | + | ||
- | === Test === | + | |
- | + | ||
- | You can create file with the name index.js and content: | + | |
- | + | ||
- | <code>var http = require('http'); | + | |
- | var server = http.createServer(function(req, res) { | + | |
- | res.writeHead(200, {'Content-Type': 'text/plain'}); | + | |
- | var message = 'It works!\n', | + | |
- | version = 'NodeJS ' + process.versions.node + '\n', | + | |
- | response = [message, version].join('\n'); | + | |
- | res.end(response); | + | |
- | }); | + | |
- | server.listen(); | + | |
- | </code> | + |