Nodejs puas xav tau lub Web server?
Nodejs puas xav tau lub Web server?

Video: Nodejs puas xav tau lub Web server?

Video: Nodejs puas xav tau lub Web server?
Video: Merging PDFs with Python! 2024, Kaum ib hlis
Anonim

Nws tuaj yeem khiav standalone yam tsis xav tau webserver vim nws yog runtime nws tus kheej tab sis dua nws yog tsis yog a webserver . Tag nrho Node tej yaam num tso cai ntshuam ntawm NPM pob khoom rau hauv ib qhov project los ntawm kev tsim npm nruab hais kom ua.

Ua li no, node js puas xav tau lub Web server?

js muab peev xwm los tsim koj tus kheej web server uas yuav lis HTTP thov asynchronously. Koj tuaj yeem siv IIS lossis Apache los khiav Node . js web daim ntawv thov tab sis nws pom zoo kom siv Node . js web server.

Tsis tas li ntawd, kuv yuav ua li cas khiav lub node JS web server? NodeJS - Teem lub HTTP Server Yooj Yim / Local Web Server

  1. Download tau thiab nruab NodeJS.
  2. Nruab lub pob http-server los ntawm npm.
  3. Pib lub web server los ntawm cov npe uas muaj cov ntaub ntawv lub vev xaib zoo li qub.
  4. Xauj rau koj lub vev xaib hauv zos nrog browser.

Tom qab ntawd, lo lus nug yog, node js puas xav tau Apache?

Node . js zoo li lub npe rov qab ib yam nkaus, tab sis qee tus neeg tsim khoom nyiam siv lwm yam cuab yeej rau ua nws (hauv kuv lub lag luam, peb siv Nginx nrog qee qhov ntawm peb node . js apps). Yog li, luv luv: Koj tsis ua xav tau Nginx lub Apache tag nrho, tab sis koj tuaj yeem siv yog tias koj xav tau.

Lub server twg zoo tshaj rau Node JS?

Yog tias koj nug txog HTTP server rau Node. js: Feem ntau ntawm cov node-servers yog tsim los ntawm 'http' module zoo li expressJs rau nruab nrab load koj tuaj yeem siv ncaj qha. Tab sis rau kev thauj khoom siab dua koj tuaj yeem siv lwm tus http servers xws li ' nginx ua ' as proxy server. Ua raws li cov lus qhia no txhawm rau teeb tsa nginx ua raws li proxy server.

Pom zoo: