First, configure the development environment:1. Install node first(1), Access http://nodejs.org Open the installation package, normal installation, click Next. To test whether the installation was successful, open a command prompt, enter node, and enter node. JS Interactive mode. Installing
combinations to connect multiple MongoDB servers. Example: mongodb://host1:270017, host2://270017, Host3:270017/testdb
Port
The port to use when connecting to the MongoDB server. The default value is 27017
Database
The name of the database to connect to. Default to Admin
Options
The key-value pair for the option used when connecting. You can specify these options on the dbopt and serveropt p
Today, our goal is to use Django,redis, and Socket.io to build a real-time chat room. Although almost all Web applications can be built in a chat room. This article will tell you at a high level how to transform a rest-based application into a real-time web application. I'll use Django to create rest parts, and actually freely use any of your comfortable language/frameworks. Next, let's jump into the code and first enumerate the parts we need.
Composition
Django 1.4+
Redis 2.6.x (versi
NodeJS operation MySQL1. create a table in the database (lzq in example) (teachers in example ). 2. Install the MySQL driver for nodeJS: npminstallmysql; 3. Run the startSQL. js file: nodestartSQL. js4. test environment: node. js0.... Synta
NodeJS for MySQL operations
1. Create a table (such as teachers) in the database (such as lzq ).
2. Install the MySQL driver for nodeJS:Npm install mysql;
3. Execute the
download of the 1.node installation packagehttp://www.nodejs.org/download/This is the official address ~If you are also a Windows system, install Windows Installer (. msi). 2. Installing NodejsDouble-click the installation package is the next step, nodejs or more humane. He will automatically help you to match the environment variables.I made a mistake here when installing node's installation package, error 2502,error2503 the wrong reason is that you
Recently using node. js and WebSocket wrote an online chat room, looking for a support node. js and support WebSocket free platform deployment up, my personal blog site is deployed on Sina SAE, but Sina SAE does not support node. js
Recently, I have been studying nodejs. nodejs is a parallel and event-based javascript development environment. This is easy to say, but it has made me suffer a lot during development. The following describes how to build the node. js development environment.
I developed it in windows, so I set up the node. js develop
This article will introduce a Node. js to handle GET/POST requests. I hope this method will help you all.
We need to view the HTTP request,
Extracts the request URL and GET/POST parameters from it,
Then "Route" runs the corresponding code based on the data.
To parse the data, we need an additional Node. js module,
They
Use node. js to create the website foreground background
What can node. js do? I still don't know where he is widely used, and I have no chance to access such a project. Just because I like it, I made a website and background in my spare time. I deeply understand that if you like a technology, you can play with it, but
I. Installation considerations for node. js1. Reference http://www.runoob.com/nodejs/nodejs-install-setup.html2.node.js If you do not configure the Package.json file, you will receive a warning NPM WARN saveerror enoent:no such files or directory ... Enter NPM init to configure the file3. If the NPM file is missing, select Repair in the Control Panel, program.4. Express error occurs, you need to install Exp
} islogin () {console.log (' base islogin ');}}//index controller, Admin/controller/index.controller.jsimport base from "./base.controller"; Export default classExtends base{Constructor () {super ();Console.log (' index constructor ');} index () {super.islogin ();Super.json ({msg: ' This is a msg '});Console.log (' index index '); }}All of the features in ES6/7 can be used in the project, and Babel can be compiled to run stably in the >=0.12.0
This is a free article on how to develop MongoDB, Node. js, and RockMongo applications on a Windows machine through OpenShift Online. This is not a title because it is too long. Cool. Now let's take a look at what's going on.
OpenShift Online-Red Hat public cloud program development and hosting platform, which can automatically configure, manage, and expand applications so that you can focus on writing busi
Koahub.js Demokoahub.jsKoahub.js--node. JS Web Rapid Development framework based on the Koa.js platform. Features such as ES6/7 (Generator Function, Class, Async Await) can be directly used in the project and can be run stably on the node. JS Environment with Babel compilation.GitHub Address: Http://github.com/einsqin
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
Create a self-signed HTTPS server with node. js
Create your own CA agency
Create a server-side certificate
Create a client certificate
Package the Certificate
Create your own CA agency
Generate a private key for a CA
OpenSSL genrsa-out ca-key.pem-des 1024
Generate CSR from CA private key
OpenSSL Req-new-key ca-key.pem-out Ca-csr
collection.Db.users.find () \ Query the document you added 3. Project Connection Database Create a folder under the project root directory database, and then create a db.js E:\test \ Database\db.js [HTML] View plain copy
var mongoose = require (' Mongoose ');
var db = mongoose.connect (' Mongodb://localhost/text ');//; Connect to database
var Schema = Mongoose.Schema; Create a model
var userschema = new Schema ({
Name:string,
Password:string
}); A new model has be
When Ajax uses jquery to request data from a server or send data to the server, it often encounters cross-domain errors that cannot be requested, and the common solution is to use JSONP in Ajax. Based on security considerations, the browser will have the same origin policy, but the Implementing JSONP in node. JS is very simple, with the following code we return from the server and run a JavaScript function,
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.