NodeJS [2] - 웹서버구동, 외부IP 접근 서버는 Google Cloud를 이용한다.IP는 외부IP로 접근할것이다. vim 으로 만들어준다. const http = require('http'); const hostname = '내부 ip 혹은 로컬주소'; const port =포트번호; http.createServer((req, res) => { res.writeHead(200, { 'Content-Type': 'text/plain' }); res.end('Hello World\n'); }).listen(port, hostname, () => { console.log(`Server running at http://${hostname}:${port}/`); }); 웹서버 실행! 안된다.. $sudo..
NodeJS [1] - 설치와 콘솔출력 1. 설치 - https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions 참고 $sudo apt-get install curl $curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - sudo : super do 약자, 다른 사용자의 보안권한과 관련된 프로그램을 구동할수 있게 해주는 프로그램apt-get : 패키지 관리 명령어 도구curl : 인터넷 전송을 위한 도구 node 8. 대를 깔았다. 버전확인 8.9.1이다. 설치확인을 위해vim 문서명 console.log('Hello node'); 뒤 저장후..