I have prepared a stand alone Node.js file (shown below). It works as
expected. When I ran the code, I gave a command in a DOS window -
C:......\folder_name>*node file_name.js*. While the server was listening, I
put a URL in the browser address bar. After I finished the test, I manually
terminate the Node.js code using CTRL+C.
Now, I have to do the same thing in a big project/application. And I am
lost. I do not know how it works:
1.
To run a big project/application, we simply put a URL in the browser
address bar. We do not give a command in a DOS window, such as *node
file_name.js*. How do I start the code in a big application?
2.
The big project/application runs on the WebLogic server and its port is
7171. Here in my stand alone Node.js code, I define a server and it listens
on 8080.
3.
To run a big project/application, I do not manually terminate a specific
file. How does the Node.js file (the code below) gets terminated in a big
application?
Please help. Thank you very much.
var http= require('http'),
url = require('url'),
server;
server = http.createServer(function(req, res){
var path = url.parse(req.url).pathname;
switch (path){
case '/lens/v1/ping':
res.writeHead(200, {'Content-Type': 'text/plain'});
res.write('The lens route works!\n');
res.end();
case '/ecrud/v1/core/ping':
res.writeHead(200, {'Content-Type':
'text/plain'})
res.write('The ecrud route works!\n');
res.end();
break;
default: send404(res);
}
}),
send404 = function(res){
res.writeHead(404);
res.write('Status 404');
res.end();
};
server.listen(8080);
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.