About node.js study notes

Node.js

  1. Advantage:

    • Performance, node.js faster than php 86 times.

    • The front desk with convenient js

    • Node.js front end to facilitate learning

  2. Running node.js need to run the directory node

  3. js usable, node.js can use

  4. web ----- 80 port, port 110 -----mail, database port 3306 -----

  5. node.js ------ server

  6. fs.readFile (file name, the callback function) fs.writeFile (file name, content, callback)

  7. Www file request file in a project can have only one ---- www folder

  8. http module, fs module;

  9. Data Request:

    • Front desk --- from, ajax, jsonp

    • As background -----

    • Reception <---> background (both through http request)

    • Different ways ---- GET request (data url), post (data not url)

  10. Resolve the port is occupied: CMD> netstat -ano | findstr 8080 CMD> taskkill / F / PID 1234 (process 1234 IV below show the number)

  11. GET data analysis

    • Cut yourself

    • querystring xxx=xxx&xxx=xxx

    • urlLib aaa?xxx=xx&xx=12

    • urlLib.parse(url,true) parhname

    • query

  12. POST data request: POST data is much larger than the GET data

    • POST great need ---- --- transmission segment receiving segment

  13. register log in

    First, determine the interface:

    • (Registered) has a user interface to: / user act = reg & user = aaa & pass = 123456?

      Reception is returned to a json --- { "OK": false, "msg", "Cause"}

    • (Log) has a user interface to: / user act = login & user = aaa & pass = 123456?

      Reception is returned to a json --- { "OK": true, "msg", "Cause"}

  14. Activity: file access, interfaces access

  15. Modular:

    • System module; http, querystring, url

    • Custom Modules

    • Package Manager

  16. Crypto encryption

    Events Events

    Net network operations

    OS operating system information

    Path processing file path

  17. Custom modules:

    • Modules

    • asl

    • Post your own module

    • Introduced their own modules -----------./

    • ----- external output something must be added to exports

    •  

     

Guess you like

Origin www.cnblogs.com/dys6/p/11328970.html