Node. js is the best choice for Web application development.
The entry of a disruptive technology into the technology market is always a shock, but it is often abandoned. However, this is certainly not the case for Node. js. It is
CaseLet's set the goal to a simple point, but it's practical enough:
Users can use our app through a browser.
When the user requests Http://domain/start , you can see a welcome page with a file upload form on the page.
The user can select a picture and submit the form, and then the file will be uploaded to http://domain/upload, which will display the image on the page when the page is uploaded.
Almost, you can now go to Google, find something to mess around to complete the
What is Express.jsExpress is a simple and flexible node. JS Web application framework that provides a range of powerful features to help you create Web applications, provide rich HTTP tools, and take-out middleware from the Connect framework, creating robust, friendly APIs t
Web AppsExpress is a minimalist, flexible Web application Development framework based on the node. JS platform that provides a range of powerful features to help you create a wide variety of web and mobile device applications.ApiR
Static resource ManagementIn the HTML page. The CSS file generates an HTTP request to get the CSS file resource, issuing the request URL, butThere is no information for this resource to play with. css files. As the server side does not know that the resource requested by the client is a. css file,The server side has no logic to handle/XX.CSS requests. Therefore does not respond normally to return a XX.CSS data.The same problem is with JavaScript files and pictures. Loading pictures and CSS styl
File System ModuleFile I/O is encapsulated by standard POSIX functions and requires access to the module using the Require (' FS ')All of these methods provide both asynchronous and synchronous approaches.1. Renaming filesvar base_dir = __dirname; Copied. 2. modify file permissions and file permission properties 3. Get file meta information 4. Read file dataFs.realfile (Path,[callback])5. Verify that the file existsFs.exists (Path,[callback])6. deleting filesFs.unlink (Path,[callback])The cal
Introduction to the most popular Node. js application development framework, node. js Application Development
Rapid development, easy scalability, high performance, and robust robustness. The emergence of
package from the official website on your own platform.Log on to your computerOpen the command line, enter heroku login, and enter the account and password as prompted.Start Application DeploymentThis section describes how to deploy node. js applications. You can perform other operations on other applications by following the steps on the official website.Deploy
This article describes how to build a Node based on zero infrastructure. js, Express, Ejs, Mongodb server, and application development. This article provides a cost tutorial for Windows 8 systems. For other systems, see, if you need a Node, refer to the Introduction Guide for front-end developers in this article. in
This article describes how to build a Node based on zero infrastructure. js, Express, Ejs, Mongodb server, and application development. This article provides a cost tutorial for Windows 8 systems. for other systems, see, if you need a Node, refer to the introduction guide for front-end developers in this article. in
has its weakness, mainly manifested in three aspects: failure to use multi-core CPU; error may cause the entire application to exit, and the robustness of the application is worthy of further study; A large amount of computing will occupy the CPU and thus cannot continue to call asynchronous I/O.
To solve the above problem, Node adopts the same idea as HTML5
can Do)
2. Command-line tools
Note 1: The BS programming model for any server-side technology is the same, and language-independent
Note 2:node No HTML files, only. js files
Now count the 10 scenarios of node. JS:
1.Web Development: Express + EJS + mongoose/mysql
Express is
organize the front-end code and load NPM modules. In the browser, call the Browserify compiled code, also written in the
The operation of Browserify is divided into 3 steps. 1. Write node program or module, 2. Pre-compiled with browserify into Bundle.js, 3. Load the bundle.js in the HTML page.
2. Command-line programming tool: Commander
The commander is a lightweight Nodejs module that provides user command line input and parameter parsing power. Co
When we use PHP to write background code, we need to use Apache or Nginx HTTP server, with MOD_PHP5 modules and php-cgi.From this perspective, the entire "Receive HTTP request and provide Web page" requirement does not need PHP to handle at all.But for node. JS, the concept is completely different. When using node.
Get started with Node. js, Express, Ejs, Mongodb server, and application development, node. jsmongodb
This article is a guide for front-end developers to build a Node from scratch. in js, Express, Jade, and Mongodb server, the rea
code is as follows:
$ Node server. js
Visit http: // 127.0.0.1: 3000/. the browser displays the following content:
Hello, world!
Visit http: // 127.0.0.1: 3000/Zhang San. the browser displays the following content:
Hello, % E5 % BC % A0 % E4 % B8 % 89!
The routing logic runs normally.
Note:The method parameter can be any valid HTTP method or asterisk ).The path parameter defines the access path, which can
Code is as follows:
$ Node server. js
Visit http: // 127.0.0.1: 3000/. The browser displays the following content:
Hello, world!
Visit http: // 127.0.0.1: 3000/Zhang San. the browser displays the following content:
Hello, % E5 % BC % A0 % E4 % B8 % 89!
The routing logic runs normally.
Note:The method parameter can be any valid HTTP method or asterisk ).The path parameter defines the access path, which can
This article mainly introduces how to use Meteor with Node. js Code example of real-time chat application, Node. as an asynchronous framework, js is used to compile real-time applications. For more information, see Derby. the framework for
Node. js supports multi-user web Terminal Implementation and security solutions, and node. js supports multiple users
As a common feature of local IDE, terminal (command line) supports git operations and file operations of projects. For WebIDE, without a
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.