The first step is naturally installed, I am using webstorm this IDE, the installation is divided into 2 steps:1, install Nodejs, download the installation version under Windows, note that the MSI is the extension, and then the next step, nothing to say, as follows:32-bit msi:http://nodejs.org/dist/latest/64-bit msi:http://nodejs.org/dist/latest/2, install WebStorm8.0.3, as if will automatically find Nodejs installation path, do not need to configure what East;Install Webstorm, start it, then cre
1. Global objectsAll modules can be called1) Global: Indicates that node is in an environment similar to the Window object in the browser.2) Process: points to Node's built-in process module, allowing developers to interact with the current processes.For example, if you enter node directly in a DOS or terminal window, you will enter node's command line (REPL envi
1. Global objectsAll modules can be called1) Global: Indicates that node is in an environment similar to the Window object in the browser.2) Process: points to Node's built-in process module, allowing developers to interact with the current processes.For example, if you enter node directly in a DOS or terminal window, you will enter node's command line (REPL envi
Node. js remotely connects to the MongoDB database server on another host
My MongoDB is installed in linux.
First, add a user
1. First, run the terminal command line on the MongoDB server host and enter
Mongo
2. Enter use admin to access the user management database.
3. db. addUser ("username", "password"); here, the username and password are the username and pas
1. Prepare a folder for the project2. Create a server.js file under the root directory3. The file code is as followsvar http = require ("http");Http.createserver (function (request,response) {Response.writehead (200,{' content-type ': ' Text/plain ');Response.End ("Hello world\n")}). Listen (8080);Console.log ("Server running at http://127.0.0.1:8080/")4. Open the project directory with the command line execute the node server.js command5. Open the co
Open service:The code is as follows:varHTTP = require ('http'); Http.createserver (function (request, response) {//Send HTTP Header//HTTP Status value: 200:ok//content Type: Text/plainResponse.writehead ( $, {'Content-type':'Text/plain'}); //Send response data "Hello World"Response.End ('Hello world\n');}). Listen (8888);//The terminal prints the following informationConsole.log ('Server running at http://127.0.0.1:8888/');
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.