🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.javascript
Article #50838

Re: [DevMeeting] Wydajność Node.JS kontra reszta świata

#50838
From: NKAB -
Date: Wed, 24 Aug 2011 08:41
46 lines
1642 bytes
Wpadłem na pomysł jak to używać w win.

w katalogu C:\NODE
tworzymy plik o nazwie np:

NodeJS.bat

o treści:

node helo-nodejs.js
pause





a plik helo-nodejs.js ma treść:


var http = require('http');
http.createServer

(function (request, response)
 {
  response.writeHead(200, {'Content-Type': 'text/plain'});
  response.end('Hello World\n');
 }
).listen(8124);

console.log('Server running at http://127.0.0.1:8124/');


Po dwukrotnym kliknięciu naszego NodeJS.bat
uruchomimy nasz serwerek www.

Otwieramy przeglądarkę i w adres wpisujemy:

http://127.0.0.1:8124

.. i sukces, jest nasze Hello world.

Andrzej.


-- 
Wysłano z serwisu Usenet w portalu Gazeta.pl -> http://www.gazeta.pl/usenet/
Technical Details
Message-ID: <j32dgi$6n$1@inews.gazeta.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!not-for-mail
References: <962d9bef-97f9-44d0-82f5-24d9f104942a@glegroupsg2000goo.googlegroups.com> <j328ik$cnm$1@inews.gazeta.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!not-for-mail
From: "NKAB -" <nkab@WYTNIJ.gazeta.pl>
Newsgroups: pl.comp.lang.javascript
Subject: Re: [DevMeeting] Wydajność Node.JS kontra
 reszta świata
Date: Wed, 24 Aug 2011 08:41:54 +0000 (UTC)
Organization: "Portal Gazeta.pl -> http://www.gazeta.pl"
Lines: 46
Message-ID: <j32dgi$6n$1@inews.gazeta.pl>
References: <962d9bef-97f9-44d0-82f5-24d9f104942a@glegroupsg2000goo.googlegroups.com> <j328ik$cnm$1@inews.gazeta.pl>
NNTP-Posting-Host: localhost
X-Trace: inews.gazeta.pl 1314175314 215 172.20.26.239 (24 Aug 2011 08:41:54 GMT)
X-Complaints-To: usenet@agora.pl
NNTP-Posting-Date: Wed, 24 Aug 2011 08:41:54 +0000 (UTC)
X-User: nkab
X-Forwarded-For: 85.89.190.17
X-Remote-IP: localhost
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit