Skip to content

Instantly share code, notes, and snippets.

@egoing
egoing / linux(ubuntu)에서 nodejs server 실행하기.md
Last active January 8, 2021 16:23
linux(ubuntu)에서 nodejs server 실행하기

linux에서 nodejs를 80번 포트에서 실행

80번 포트는 root 권한으로만 실행이 가능하기 때문에 보안적으로 좋은 방법은 아닙니다.

sudo apt update;
sudo apt install -y nodejs npm; 
echo "var http = require('http');
var app = http.createServer(function(req, res){
	res.end('hi');
});
app.listen(80);" > index.js;