LoginSignup
2
1

More than 5 years have passed since last update.

Ubuntuでnodejs入れてみる

Posted at

何番煎じかわからないけど、自分用のメモ

環境

Ubuntu14.04(64bit)

nodejsのインストール


>$ sudo apt-get install -y nodejs npm
>$ nodejs -v
v0.10.25

Hello World

hello.js
var http = require('http');
http.createServer(function(request, response) {
    response.writeHead(200, {'Content-Type': 'text/plain'});
    response.end('Helllo World¥n');
}).listen(8080);

>$ nodejs hello.js

待機状態になったらブラウザからアクセスする。


>$ http://hostname:8080

スクリーンショット 2015-04-14 23.51.50.png

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1