As a good Restfull Api, it is not only about the semantics, readability, power, and orthogonal of service URLs, but also about http Status codes. A good Http Status Code gives users a good response, for example, 200 indicates normal success, 201 indicates successful creation, 409 conflict, and 404 resource does not exist. Therefore, we are working on a node-based architecture. node is found in
, this is all a small problem.This static class still finds minor problems:Here is a base class. Person.js file name./* defining the person base class */ module.exports=function() { this. name= ' person '; this. sleep=function() { console.log (' person sleep '); } this. eat=function() { console.log (' person eat ');} }Then here is
This article introduces the use of Node. js is Node. js generates the HttpStatusCode helper class and releases it to npm. If you need it, you can refer to it. As a good Restfull Api, not only does it lie in the semantics, readability, power, and orthogonal of service URLs, a
HeaderAdditional Information: Content type, Server send response date, HTTP status codeBody InformationUser-submitted form data, or the returned dataRequest method for HTTPGet: GET, read dataPOST: Submitting data to a specified resourcePUT: UpdateDelete: RemoveHEAD: Similar to get, the server does not return all dataStatus code
1xx
The identity request is accepted
2xx
The request was successfully accepted and disposed of
3xx
redirect
{ //Ball on the left if(MarginLeftdistance) {MarginLeft++ }Else{ //the ball is on the rightmarginleft-- } //adjust the position of the ballBall.style.marginLeft=MarginLeft animate (ball, distance, CD)}, -) } //Control AnimationsAnimate (Ball1, -,function() {animate (Ball2, $, function() {animate (Ball3, Max, function() {animate (Ball2, Max, function() {animate (Ball
As a good Restfull Api, it is not only about the semantics, readability, power, and orthogonal of service URLs, but also about http Status codes. A good Http Status Code gives users a good response, for example, 200 indicates normal success, 201 indicates successful creation, 409 conflict, and 404 resource does not exist. Therefore, we are working on a node-based architecture. node is found in
As a good Restfull Api, it is not only about the semantics, readability, power, and orthogonal of service URLs, but also about http Status codes. A good Http Status Code gives users a good response, for example, 200 indicates normal success, 201 indicates successful creation, 409 conflict, and 404 resource does not exist. Therefore, we are working on a node-based architecture. node is found in
just want to do a grunt operation on a JS file, you do not need to create Index.js and Lib folder files, directly put the file in the root directory, and then the Gruntfile.js file in the path to change it.?Appendix 2:How to create a sample gruntfile.
Installing GRUNT-CLI
NPM install-g GRUNT-CLI
?
Install the Windows version of Git.
Create an empty folder.
Navigate to the new fol
(this. Words) Console.log ( This = =pet) }}pet.speak ()This points to the global objectfunction Pet (words) { this. Words = words console.log (this. words) Console.log (this = = Global)}//This points to the global globally object Pet (' ... ')This points to the instance objectfunction Pet (words) { this]words = words thisfunction() { Console.log (this. words) Console.log (this) }} varNew Pet (' Miao ') cat.speak ();Using call and apply to change the c
Buffer(logo.png)The following code reads Logo.png as the buffer typeThen convert the buffer to a stringYou can configure a string:data:image/png;Base64,Buffer.toString()varFs= require(' FS ')FS.ReadFile(' Logo.png ',function(Err,Origin_buffer){ Console.Log(' origin_buffer If buffer format: '+Buffer.Isbuffer(Origin_buffer))//console.log (' Read to Origin_buffer: ' + origin_buffer) //Create file FS.WriteFile(' Log_buffer.png ',Origin_buffer,function(ERR){ if(ERR)Console.Log(ERR)})/
Plus () { SetTimeout (function() { console.log (' aaa ') },+) C +=1;} Plus () print ()AsynchronousEach task has multiple callback functions, and the previous task does not perform the next task, but instead executes the callback function, and the latter task executes in the order in which the task is sorted, not waiting for the previous task to complete// asynchronously executes the callback function after the task execution completes var c=0function print () { console.log
Getting started with Node. js development-notepad ++ for Node. js and node. jsnotepad
For Node. js development, IDE,WebstormIt is the best option, but it is charged (free for 30 days )
This article mainly introduces four js key points that Node. JS developers must understand. Node. js is a server-oriented framework based on Chrome's powerful V8JS engine. Although it is compiled by C ++, it and its applications run on J
The fourth chapter recommends 3 hours of study time 10 chaptersHow to learn: read it in detail and implement the relevant code manuallyLearning Goals : This tutorial will teach you to install node, build servers, Express, MySQL, MongoDB, write background business logic, write interfaces, and finally complete a complete project backstage, a total of 10 days is expected.node. js Event mechanismnode.
J2SE quick advanced -- four basic abstract classes of IO stream: InputStream, OutputStream, Reader, Writer, and abstract class
The above section briefly describes the four abstract classes in the java. io package and Their Relationships. Here we will further summarize them and their subclasses.
At the end of the previ
Node. js asynchronous I/O learning notes, node. js learning notes
The term "Asynchronous" is widely used in the Web 2.0 wave, which swept the Web along with Javascript and AJAX. Asynchronous programming is rare in most advanced programming languages. PHP can best reflect this feature: it not only shields Asynchronizati
This article mainly introduces Node. the buffer and stream modules in js are described in detail. This article describes the Buffer modules, classes: buffer, write Buffer, copy buffer, and stream module. For more information, see
Buffer module
Js was originally designed for browsers, so it can handle unicode encoded strings well, but cannot process binary data w
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.