Sach Lap Trinh Nodejs That Don Gian Sample

October 8, 2022 | Author: Anonymous | Category: N/A
Share Embed Donate


Short Description

Download Sach Lap Trinh Nodejs That Don Gian Sample...

Description

 

 

 

MỤE IỤE Iờg `õg Ěạu  Eêeb bọe Ěû`a eêeb  Wëu e ạu tré`b Ěỗ  Igë` bề vở g têe agấ 

Agở g tbgều  Agở g tbgều ủ `a `a dợ`a hifa sẽ xèy dỺ ` `a a  @fdc.ks iî aé6  Eîg Ěằt @fdc.ks TẪf scrvcr @fdcks Ěạu tgë` Bg ễu  ễu bƪ` vỊ rcqucst vî rcspf`sc

Agở g tbgều v Ị @^M vî Cxprcss  

Eîg Ěằt Eustfm ^jeojac vở g @^M  Agở g tbgều Cxprcss  Rử  iý  iý rcqucst v ở g Cxprcss  Hảt Ěổ`a hỗ vở g Ejii Hjeo  Trấ v Ị mỗt lgic btmi ebf eigc`t   Trấ v Ị stjtge rcsfurec (gmjac, ess, ks...) ebf eigc`t  Tồ`a oẶ t 

Hƾởe Ěạu tẪf wch jpp vở g Cxprcss  Tấg wch tcmpijtc  TỺ  Ěỗ`a obỖg Ěỗ`a scrvcr mốg obg tbjy Ěồg må `au ổ`  @pm stjrt  TẪf tbƾ mợe puhige ebủj tềp stjtge

TẪf ^jac rfutcs  Tồ`a oẶ t 

Tcmpijtg`a C`ag`c  Agở g tbgều Tcmpijtc c`ag`c  Ijyfut  Tồ`a oẶ t   

Trj`a 8

 

Agở g tbgều Mf`afDH  OgẶ ` trûe eỡj Mf`afDH 

Eîg Ěằt Mf`afDH  OẶ t `Ớ g vî quấ` iý Mf`afDH vở g Xfhf 5T 

Eîg Ěằt Mf`affsc  OẶ t `Ớ g Mf`afDH tữ  @fdc.ks  @fdc.ks 

Ğỏ`b `abħj Mfdci  TẪf eêe jetgf` EXSD v ở g Mf`affsc mfdci  Iả y dỦ  ig  igều tữ  Mf`afDH  Mf`afDH  Spdjtc dfeumc`t 

Rõj mỗt dfeumc`t  Tồ`a oẶ t 

`a dợ`a Mf`afDH vîf dỺ  ê`  ê`  Ợ `a  igều hîg ^fst vîf Djtjhjsc  Iƾu dỦ  ig Bgễ` tbỏ dj`b sêeb eêe hîg ^fst  Bgễ ` tbỏ dỦ  ig  igều Ěỗ`a vở g Tcmpijtc c`ag`c  Bgễ ` tbỏ `ỗg du`a mỗt ^fst  Tbëm Lgcids vî Uebcmj 

Tồ`a oẶt  TẪf tí`b `ą`a upifjd ấ `b vở g Cxprcss 

Tồ`a oẶt  Tém bgễu Cxprcss Mgddicwjrc 

Mgddicwjrc t÷y ebệ`b  TẪf vî Ěą`a oý \jigdjtgf` mgddicwjrc  Tồ`a oẶt  Xcljetfrg`a tbcf mô bé`b M\E  Agở g tbgều mô bé`b M\E  TgẶ ` bî`b Xcljetfrg`a 

Tồ`a oẶt  TẪf tí`b `ą`a Ěą`a oý tbî`b vgë`  Sscr Mfdci  Ef`trfiicr xử iý Ěą`a oý uscr 

 

Trj`a 5

 

Må bõj mật ob ầu Mf`affsc \jigdjtgf`

TẪf tí`b `ą`a Ěą`a `bập 

Tồ`a oẶt  Rêe tbỺ e vở g Cxprcss Ucssgf`s  Gmpicmc`tg`a Sscr Ucssgf`s  ^rftcet mỗt ^jacs `îf Ěõ vở g Jutbc`tgejtgf` Mgddicwjrc  Sscr Ifafut  TẪf trj`a 4>4 

Tồ`a oẶt  Trgễ` objg wch jpp ië` scrvcr tb ật 

Eîg Ěằt scrvcr  :. Eîg Ěằt @AG@R vî Agt  8. Eîg Ěằt @fdcKU vî mf`afDH  5. Eîg Ěằt ^M8  Ğƾj sfurecefdc @fdc.ks ië` \^U  Zuấ` iý ủ `a `a dợ`a @fdc.ks hẺ`a ^M8  OẶ t `Ớ g dfmjg` vîf vps  Eả u bé`b @ag`x Xcvcrsc ^rfxy Ucrvcr  Ebîf tẪm hgềt

Tîg igều tbjm obấf 

 

Trj`a 4

 

Iờg `õg Ěạu

@

fdc.ks Ěj`a trỖ  tbî`b  tbî`b mỗt xu bƾở `a `a eỡj agở g iập tré`b hjeo-c`d. Eõ rả t `bg  Ị Ịu ủ `a `a dợ`a iở ` eỡj eêe ĚẪg agj Ěj`a sử  d  dợ`a @fdcks. Eõ tbễ   ooễ  të` `bƾ; ^jypji, @ctligx, Ig`ocdG`...

Mợe tgëu eỡj euỚ` sêeb `îy Ěõ iî agûp eêe hẪ` hƾở e vîf tbẶ   ag agở g eỡj @fdc.ks mỗt eêeb vỦ `a `a ebẦe `bả t. t. Tủ e iî hẪ` sẽ bgễu ró Ěƾụ e hấ` ebả t, t, eêeb xèy dỺ `a `a ủ `a `a dợ`a @fdcks mỗt eêeb hîg hấ` `bả t. t. Tbật obô`a quê obg aọg iî "vŧ trợ @fdc.ks ". "\ŧ trợ @fdc.ks " hẦt `au ổ` tữ  vgë`  vgë` aẪeb Kjvjsergpt.

Ğễ  obêm pbê "\ŧ trợ @fdc.ks " mỗt eêeb trƪ` tru, euỚ ` sêeb `îy sẽ agûp eêe hẪ` tém bgễ u "tjm trợ" eƪ hấ` eỡj @fdc.ks, Ěõ iî @fdc.ks, CxprcssKU, vî Mf`afDH. Mốg pb ạ` trf`a euỚ ` sêeb `îy sẽ Ěƾụ e tré`b hîy tbẵ`a vîf vả` ĚỊ, ogẶ ` tbủ e trọ`a tèm Ěễ  trê`b  trê`b mả t tbờ g agj` vî`a `aọe eỡj hẪ`. Uju obg hẪ` Ěọe xf`a euỚ ` sêeb `îy, hẪ` sẽ Ěỡ oỷ `ą`a Ěễ   ttỺ  mé`b  mé`b xèy dỺ `a `a mỗt wch jpp hẺ`a @fdcks vî trgễ ` objg `õ trë` G`tcr`ct.

Eêeb bọe Ěû`a eêeb  EuỚ ` sêeb `îy mé`b ebgj `b Ệ `ỗg du`a tbî`b :8 pb ạ`, mốg pb ạ` sẽ agở g tbgều mỗt ebỡ   hẪ` eõ tbễ  eb  ebỡ Ěỗ`a iỏeb bọe, obô`a hỏ d ổ` `ç` quê `bg  Ị ĚỊ rgë`a hgềt. Mợe Ěíeb iî Ěễ  h Ịu. \ở g mốg pb ạ` iý tbuyẶt, mé`b ĚỊu eõ ví dợ mg`b bọj vî efdc iuô` vîf dỺ  ê`.  ê`. \é vậy, eêeb  mé`b vgẶ t iẪg tữ `a `a dø`a efdc vî bọe tỚ t `bả t vắ` iî vữ j bọe vữ j tbỺ e bî`b. HẪ` `ë` tỺ  mé`b ebẪy `õ. Ğữ `a `a efpy eấ ĚfẪ` efdc trf`a sêeb, ĚgỊu `îy sẽ iîm bẪ` ebẶ  ob  obấ `ą`a vgẶ t efdc eỡj hẪ`, eŧ`a `bƾ iîm hẪ` `bg Ị  Ịu obg obô`a bgễ u vé sjf efdc hỏ iốg. @bở  `bç, Ěọe ĚẶ ` Ěèu, tỺ  vg  vgẶt efdc ĚẶ` Ěõ, tỺ  hugid  hugid vî ogễm trj ĚfẪ` efdc Ěõ ebẪ y Ěû`a obô`a! 

 

Trj`a 3

 

Wëu e ạu tré`b Ěỗ  EuỚ ` sêeb `îy mé`b xèy dỺ `a `a tữ  `b  `bỦ `a `a ogẶ ` tbủ e ` Ị` tấ`a @fdc.ks tữ  eƪ hấ` `bả t. t. @ë` obô`a e ạ` hẪ` pbấg eõ ogẶ ` tbủ e v Ị @fdc.ks. Tuy `bgë`, vé @fdc.ks Ěƾụ e xèy dỺ `a `a trë` `aô` `aỦ  Kjvjsergpt  Kjvjsergpt `ë` sẽ tỚt bƪ` `Ặ u hẪ` Ěå eõ ogẶ ` tbủe eą` hấ` v Ị Kjvjsergpt. @afîg rj, hẪ` eŧ`a eạ` ebût bgễ u hgẶ t v Ị BTMI vî EUU Ěễ   ddỺ `a `a agjf dgề` wch.

Igë` bề vở g têe agấ  @Ặ u eõ hả t oỵ vả` ĚỊ aé trf`a quê tré`b bọe, efdc hỏ iốg bfằe obô`a bgễ u, u, eêe hẪ` eõ tbễ   igë` bề vở g mé`b quj mỗt trf`a `bỦ `a `a bé`b tbủe dƾởg Ěèy;  bttps;//v`tjiog`a.efm     Qchsgtc;  Qchsgtc; bttps;//v`tjiog`a.efm   Lj`pjac; Lj`pjac;  bttps;//ljechffo.efm/v`tjiog`a bttps;//ljechffo.efm/v`tjiog`a     Cmjgi; Cmjgi;  suppfrtNv`tjiog`a.efm suppfrtNv`tjiog`a.efm  



 

bttps;//agtbuh.efm/v`tjiog`a/`fdcks-cxprcs m/v`tjiog`a/`fdcks-cxprcss-mf`afdh-efs-mf`afdh-ef-hj` hj`   Agtbuh;  bttps;//agtbuh.ef   Agtbuh;



 

Trj`a <

 

^B Ậ@ :

Agởg tbgều

@

fdc.ks iî mỗt KjvjUergpt ru`tgmc Ěễ  eb  ebẪy Kjvjsergpt pbíj scrvcr. Eõ r ả t `bg  Ị Ịu eô`a ty Ěå sử  d  dợ`a @fdc.ks Ěễ  xèy  xèy dỺ `a `a ebf ủ `a `a dợ`a eỡj bọ. Eõ tbễ   ooễ  m  mỗt sỚ   të` tuồg Ěé`b Ěêm `bƾ; QjiMjrt, Ig`ocdG`, ^jy^ji, WfuTuhc, Wjbff!, Jmjzf`.efm, @ctligx, cHjy vî Xcddgt. Trf`a euỚ ` sêeb `îy, ebû`a tj sẽ bọe @fdc.ks oẶ t bụ p vởg Cxprcss vî mf`afDH Ěễ  xèy  xèy dỺ `a `a mỗt hifa tữ  Ěạu, tữ  ef`  ef` sỚ  >.  >. Trf`a quê tré`b Ěọe vî tbỺ e bî`b tbcf sêeb, hẪ` sẽ  bgễ u vî tỺ  mé`b  mé`b xèy dỺ `a `a mỗt ủ `a `a dợ`a rgë`a tữ  `b  `bỦ `a `a oỷ tbuật trf`a euỚ ` sêeb `îy. Ebû`a tj sẽ e÷`a `bju tém bgễ u mỗt ifẪt `bỦ `a `a oỷ tbuật `bƾ xêe tbỺe `aƾờ g d÷`a, vjigdjtc dỦ  ig  igều, hảt Ěổ`a hỗ trf`a Kjvjsergpt, Cxprcss, Mf`afDH vî tcmpijtc c`ag`c.v.v...

Agở g tbgều ủ `a `a dợ`a hifa sẽ xèy dỺ `a `a @bƾ mé`b Ěå agở g tbgều Ỗ  trë`, Ěễ  vg  vgềe bọe eõ bgều quấ, tbjy vé ebệ eõ `bỦ`a ĚfẪ` efdc mắu `aẦ` vî obô`a igë` quj` tở g `bju, ebû`a tj sẽ vữ j bọe vữ j xèy dỺ `a `a mỗt ủ `a `a dợ`a `a d ợ`a bfî` ebệ`b. Tgëu ebí iî "b "bọe ĚẶ` Ěèu, ủ `a ợ`a ĚẶ` Ěõ" . Ğèy iî agjf dgề` eỡj ủ `a `a dợ`a;

Bé`b :.:; Tcmpijtc agjf dgề` d÷`a trf`a sêeb  

Trj`a 1

 

\ởg trj`a hifa `îy, `aƾờ g d÷`a eõ tbễ  Ěą`a oý tîg obfấ` mởg. Uju obg Ěą`a oý xf`a tbé bọ eõ tbễ   vv Ị trj`a ebỡ, Ěą`a `bập vîf hifa. Tbj`b `jvgajtgf` hjr s ẽ bgễ ` tbỏ `bỦ `a `a mc`u obêe `bju t÷y tbuỗe vîf trẪ`a tbêg `aƾờg Ěå Ěą`a `bập r ổg  ổg bjy ebƾj. Ğễ  xèy  xèy dỺ `a `a agjf dgề`, ebû`a tj sẽ sử  d  dợ`a CKU tcmpijtc c`ag`c.

Uju obg `aƾờg d÷`a Ěą`a `bập, tbî`b `jvgajtfr hjr sẽ bgễ ` tbỏ tcxt "IfaFut" Ěễ   bbọ eõ tbễ  Ěą`a xuả t `Ặ u e ạ`. @afîg rj, eø` tbëm mỗt mc`u "`cw pfst" Ěễ   b bọ eõ tbễ   ttẪf hîg vgẶ t mở g,g, upifjd ấ`b ië` hifa. Uju obg b ọ tẪf hîg vgẶ t xf`a tbé qujy trỖ   iiẪg trj`a ebỡ, hifa sẽ bgễ ` tbỏ dj`b sêeb eêe hîg vg Ặt Ěå puhigsbcd. Tbô`a quj vgềe tbỺ e bî`b xèy dỺ `a `a ủ `a `a dợ`a hifa `îy, hẪ` sẽ `Ầm ebẦe Ěƾụ e ogẶ ` tbủ e v Ị @fdc.ks, oẶ t bụ p vở g cxprcss vî Mf`afDH.

@fdc.ks iî aé6 Trƾở e obg tém bgễ u obêg `gềm @fdc.ks iî aé, hẪ` e ạ` pbấg bgễu eƪ ebẶ  G`tcr`ct  G`tcr`ct bfẪt Ěỗ`a `bƾ tbẶ  `îf Ěå. Obg mỗt `aƾờ g d÷`a mỖ  tré`b  tré`b duyềt, eô ả y vîf mỗt wchsgtc `bƾ v`tjiog`a.efm ebẵ`a bẪ`. @bƾ vậy iî eô ảy Ěå tẪf rcqucst tở g scrvcr, iûe `îy eô ả y/tré`b y/tré`b duyềt Ěƾụ e efg iî mỗt eigc`t. Obg eigc`t tẪf rcqucst mỗt scrvcr vî scrvcr pbấ` b ổg vở g `ỗg du`a eỡj trj`a wch mî eigc`t yëu e ạu. Eõ mỗt sỚ  `aô`  `aô` `aỦ  i iập tré`b Ěƾụ e tbgẶ t oẶ  Ěễ  vg  vgẶ t eêe ủ `a `a dợ`a ebf scrvcr `bƾ ^B^, Xuhy, ^ytbf`, JU^, Kjvj... @Ặu trƾởe ogj, Kjvjsergpt Ěƾụ e tbgẶ t oẶ  Ěễ  eb  ebẪy trë` eêe tré`b duyềt, eu`a eả p tbëm obấ `ą`a tƾƪ`a têe eỡj trj`a wch vởg `aƾờ g d÷`a. \í dợ `bƾ eêe mc`u eõ bgều ủ `a `a drfpdfw`, bjy bgều ủ `a `a tuyẶt rƪg... 

@bƾ`a mọg ebuyề` Ěå tbjy Ěồg vîf `ąm 8>>7, obg @fdc.ks rj Ěờ g,g, sử   ddợ`a dợ`a \2 c`ag`c iîm hỗ ebẪy eêe må Kjvjsergpt. Agờ  Ěèy, Kjvjsergpt Ěå vƾụ t rj obỖ g obuô` obồ  eỡj tré`b t, vî ebf pbçp `õ ebẪKJ\J... y trë` eêe y, `afîg `aọỦ ` dî`b  dî`b ềcr @bƾĚå vậtrỖ  `bƾ ^B^, Afij`a, tbé scrvcr. Kjvjsergpt rgë`a ebfduy scrv  tbî`beêe  tbî`b mỗ`aô` t iỺ j eb sê`a agê obêe. @bỦ `a `a iụ g íeb mî @fdc.ks mj`a iẪg ebf hẪ`;   Ğạu tgë`, \2 KjvjUergpt c`ag`c iî m ỗt Kjvjsergpt c`ag`c mẪ`b mẽ, Ěƾụ e sử   d dợ`a trf`a tré`b duyềt Ebrfmc eỡj Affaic. ĞgỊu `îy sẽ iîm ủ `a `a dợ`a eỡj hẪ` eõ tỚ e Ěỗ rả t `bj`b.   @fdc.ks obuyẶ ` obíeb vgẶ t må ogễ u jsy`ebrf`fus (hảt Ěổ`a hỗ) Ěễ   e eấg tbgề` tỚ e Ěỗ ủ `a `a dợ`a, trê`b Ěƾụ e `bỦ `a `a vả` ĚỊ pbêt sg`b eỡj vgềe sử   d dợ`a Ěj iuổ`a.   Tb  5 Ịu `, df vậy hẪ` sẽ tbữj bƾỖ `a `a Ěõ tbƾ iî Kjvjsergpt iî mî mỗtiẪ`aô` Ủ   rrả t pbồ hgẶ `, rả tủ  `bg  Ịu vgề` bjy bf g mgể`a ` pbí.







 

Trj`a 2

 

  EuỚg e÷`a iî df @fdc.ks eŧ`a sử  d  dợ`a kjvjsergpt, df vậy hẪ` sẽ tậ` dợ`a Ěƾụ e `bỦ `a `a ogẶ ` tbủe Ěå eõ tữ  trƾở e, e, obg hẪ` vgẶ t ủ `a `a dợ`a d÷`a Kjvjsergpt trë` tré`b duyềt. Agờ  Ěèy, tbjy vé pbấg tém bgễ u tbëm mỗt `aô` `aỦ  m  mở g,g, hẪ` ebệ e ạ` hgẶ t  ổg. mỗt mé`b Kjvjsergpt iî Ěỡ luii stjeo r ổ



Eîg Ěằt @fdc.ks Ğễ  eîg Ěằt @fdc.ks, hẪ` vîf trj`a ebỡ `fdcks.fra (bé`b :.4) vî tấg pbgë` hấ` tƾƪ`a ủ `a `a vở g bề ĚgỊu bî`b trë` mêy tí`b eỡj hẪ`.

Bé`b :.8; Dfw`ifjd `fdc.ks

\gềe eîg Ěằt dgể` rj eŧ`a Ěƪ` agấ`. @Ặ u mêy hẪ` d÷`a wg`dfw tbé eîg Ěằt `bƾ mọg pb ạ` m Ịm obêe tbôg. HẪ` eõ tbễ  tbjm  tbjm obấf ebg tgẶt eêe eîg Ěằt ebg tgẶ t tẪg Ěèy.  Uju obg eîg xf`a, h Ẫ` eõ tbễ  og  ogễ m trj vcrsgf` hẺ`a iề`b sju; `fdc -v 

@afîg rj, obg eîg Ěằt @fdc.ks, hẪ` sẽ Ěƾụ e obuyẶ ` måg eấ @^M `Ủ j. j. `pm -v   

Trj`a 7

 

OẶ t quấ bgề` rj `bƾ bé`b :.3 iî Ěƾụ e e..

Bé`b :.5; ogễ m trj pbgë` hấ` `fdc.ks

TẪf scrvcr @fdcks Ěạu tgë` Ebû`a tj sẽ tẪf mỗt scrvcr Ěƪ` agấ` `bả t hẺ`a @fdc.ks Ěễ  eêe  eêe hẪ` dể bgễu bƪ` vỊ eêeb mỗt eigc`t tẪf rcqucst tở g scrvcr vî scrvcr pbấ` b ổg iẪg rcqucst Ěõ `bƾ tbẶ  `îf.  `îf. HẪ` eõ tbễ   ssử   d dợ`a hả t oỵ tré`b sfẪ` tbấf efdc Ěễ   vg vgẶt efdc. @bƾ mé`b tbé vắ` ĚỊ  xuả t eêe hẪ` sử   d dợ`a \gsuji Utudgf Efdc. Agờ  mé`b  mé`b sẽ tẪf mỗt tbƾ mợe vî d÷`a \gsuji Utudgf Efdc (tữ   ag agờ  mé`b  mé`b sẽ vgẶ t tẦt iî \U) Ěễ  m  mỖ  tbƾ mợe ả y. y. Eêe hẪ` tẪf mở g mỗt lgic Kjvjsergpt, Ěằt të` iî g`dcx.ks. Dƾởg Ěèy iî ĚfẪ` efdc Ěễ   ttẪf mỗt bttp scrvcr Ěƪ` agấ`; ef`st bttp rcqugrc( 'bttp') ) ef`st bttp = rcqugrc('bttp' ef`st ef`st scrvcr  scrvcr = bttp.ercjtcUcrvcr((rcq, bttp.ercjtcUcrvcr((rcq, rcs) =0 =0 {  { ef`sfic.ifa(rcq.uri) rcs.c`d('\@TJIOG@A; rcs.c`d( @fdc.ks') '\@TJIOG@A; Rg` ebîf @fdc.ks') }) 5>>>) ) scrvcr.igstc`(5>>> scrvcr.igstc`(

Agấg tbíeb efdc ef`st ef`st bttp  bttp = rcqugrc('bttp' rcqugrc( 'bttp') )

Bîm rcqugrc eõ têe dợ`a iî gmpfrt mỗt mfduic vîf tềp hẪ` Ěj`a xử  iý.  iý. Bîm `îy trf`a @fdc.ks agỚ`a `bƾ bîm gmpfrt bjy g`eiudc trf`a eêe `aô` `aỦ  obêe.  obêe. Tbjm sỚ  Ěạu vîf eỡj bîm rcqugrc iî të` eỡj mfduic Ěƾụe Ěỏ`b `abħj hẺ`a tữ  obõj  obõj cxpfrt vî trấ v Ị  pjeojac Ěõ.  Zujy iẪg ĚfẪ` efdc trë`, mé`b rcqugrc mỗt mfduic eõ të` iî bttp vî aê` `õ ebf hgẶ ` eŧ`a eõ të` iî bttp (mé`b Ěằt tr÷`a Ěễ  ebf  ebf dể `bậ` hgẶ t hgẶ ` `îy iî pjeojac `îf tbôg, ebủ  h  hẪ` eõ tbễ  Ěằt hgẶ ` hả t oỵ të` `îf hẪ` muỚ `). `). bttp iî mỗt mfduic Ěƾụ e tíeb bụ p sẳ` trf`a @fdc.ks, d÷`a Ěễ  eu`a bttp iî  eu`a eảp eêe pbƾƪ`a tbủ e

tƾƪ`a têe vởg scrvcr `bƾ ACT, ^FUT, S^DJTC...   

Trj`a :>

 

ef`st scrvcr bttp.ercjtcUcrvcr(...)  ef`st scrvcr = bttp.ercjtcUcrvcr(...)

ĞfẪ` efdc `îy agûp ebû`a tj ob Ỗ g tẪf mỗt scrvcr. Bîm `îy eõ tbjm sỚ  iî  iî mỗt bîm sỚ   vở g bjg tbjm sỚ ; rcqucst vî rcspf`sc. ef`st ef`st scrvcr  scrvcr = bttp.ercjtcUcrvcr((rcq, bttp.ercjtcUcrvcr((rcq, rcs) =0 =0 {  { ef`sfic.ifa(rcq.uri) })

rcs.c`d('\@TJIOG@A; Rg` ebîf @fdc.ks') rcs.c`d('\@TJIOG@A; @fdc.ks')

ercjtcUcrvcr()  eŧ`a obô`a pbấg iî mỗt obêg `gềm mở g mế  TbỺe rj bîm Ěƾụ e truy Ị` vîf ercjtcUcrvcr() Ěèu. Ğõ ebí`b iî ejiihjeo. Bîm ejiihjeo `îy sẽ Ěƾụ e aọg obg vgềe obỖ g tẪf scrvcr bfî` tbî`b. Trf`a Ěõ eõ bjg tbjm sỚ, rcq (rcqucst) iî ĚỚg tƾụ `a `a mî `õ `bậ` Ěƾụ e tữ  eigc`t  eigc`t (tré`b duyềt ebẵ`a bẪ`), eø` rcs (rcspf`sc) iî ĚỚg tƾụ `a `a mî scrvcr sẽ trấ v Ị ebf tré`b duyềt. Ebû`a tj eõ tbễ  iîm  iîm hả t eủ  ĚgỊu aé vởg bjg ĚỚg tƾụ`a `îy. @bƾ trf`a ví dợ trë`, mé`b Ěƪ` agấ` ebệ iî g` rj ifa ĚỚg tƾụ `a `a rcq vî trấ iẪg tré`b duyềt mỗt dø`a tbô`a hêf; bîf @ @fdc.ks fdc.ks". "\@TJIOG@A; Rg` eebîf ". ) scrvcr.igstc`(5>>>) scrvcr.igstc`(5>>>

Mốg mỗt scrvcr ĚỊu pbấg iẦ`a mỗt pfrt hả t oỵ trf`a dấg tữ  :  : -0, 88, 85, 83... @Ặ u hẪ` bỆg pfrt iî aé tbé mé`b agấg tbíeb Ěƪ` agấ` iî pfrt iî mỗt ajtcwjy oẶ t `Ớ g rj `afîg bfằe agỦ j eêe ủ `a `a dợ`a trë` scrvcr Ěƾụ e sử   d dợ`a hỖ g mỗt ủ `a `a dợ`a eợ tbễ . @Ặ u `bg Ị  Ịu ủ `a `a dợ`a e÷`a ebẪy trë` scrvcr tbé mốg ủ `a `a dợ`a sẽ sử   dợ`a mỗt pfrt obêe `bju. Trf`a ví dợ `îy, ủ `a `a dợ`a sẽ sử  d  dợ`a pfrt 5>>> vî m ọg rcqucst tởg pfrt 5>>> ĚỊu sẽ trấ  @fdc.ks " v Ị dø`a tbô`a hêf "\@TJIOG@A; "\@TJIOG@A; Rg` ebîf @fdc.ks  " Eêeb ebẪy ủ `a `a dợ`a

Ğễ  tb  tbỺ e tbg ủ `a `a dợ`a, ebû`a tj tj mỖ  e  eử j sồ iề`b (trf`a uhu`tu aọg iî tcrmg`ji, eø` trf`a wg`dfw aọg efmmj`d ^rfmpt), dg ebuyễ ` ef` trỆ tởg tbƾ mợe må `au ổ` Mgerfsflt Qg`dfws _\crsgf` ] Efpyrgabt (e) 8>>7 8>>7 Mgerfsflt Mgerfsflt Efrpfrjtgf`. Efrpfrjtgf`.

Jii rgabts rgabts rcscrvcd. rcscrvcd.

C;YagtbuhY`fdcks-cxprcss-mf`afdhC;YagtbuhY`fdcks -cxprcss-mf`afdh-ef-hj`0`fdc ef-hj`0`fdc g`dcx.ks 

bttp;//ifejibfst;5>>>  Ěễ  xcm Agờ  h  hẪ` mỖ  tré`b  tré`b duyềt vî truy eập vîf Ěỏj ebệ bttp;//ifejibfst;5>>>  xcm oẶ t quấ.  

Trj`a ::

 

HỖg vé ebû`a tj Ěj`a ebẪy ủ `a `a dợ`a trë` ebí`b mêy tí`b eỡj mé`b `ë` ebệ eõ tbễ  truy  truy eậợp`aquj euhỚ ả  `tsêeb, `a deõ `a eêe truy hẪ` etrg objg `a  ạ` euỚ gvî ẽ bƾở  ắ` tbễ  Ěễ  puhigsb eŧ`a ậpễ `Ěƾụ  d  ifejibfst. puhigsb ië`^b g`tcr`ct, oỵ jg, mé`b hả t oỵs Ěèu  truy e e.. ủ `a

Bgễu bƪ` vỊ rcqucst vî rcspf`sc Ợ `a `a dợ`a eỡj ebû`a tj bgề` tẪg mở g ebệ pbấ` b ổg dø`a ebỦ   "\@TJIOG@A; "\@TJIOG@A; Rg` ebîf @fdc.ks  " ebf eigc`t, ebf d÷ ĚẺ`a sju SXI;ifejibfst;5>>>/xxx iî aé Ěg `Ủ j. @fdc.ks j. Ğễ  eõ  eõ `bỦ `a `a xử  iý  iý pbấ` b ổg obêe `bju ebf `b Ủ `a `a SXI obêe `bju, ebû`a tj e ạ` eõ tbễ   xxử  iý Ěƪ` agấ` `bƾ sju;  ef`st scrvcr = bttp.ercjtcUcrvcr((rcq, ef`st scrvcr bttp.ercjtcUcrvcr((rcq, rcs) =0 =0 {  { gl (rcq.uri === '/jhfut') gl (rcq.uri '/jhfut') 'Tbc jhfut pjac') rcs.c`d('Tbc rcs.c`d( pjac') ciscgl ciscgl (rcq.uri  (rcq.uri === '/ef`tjet' '/ef`tjet') ) 'Tbc ef`tjet pjac') rcs.c`d('Tbc rcs.c`d( pjac') ciscgl (rcq.uri '/') ) ciscgl (rcq.uri === '/' rcs.c`d('Tbc rcs.c`d( pjac') 'Tbc bfmc pjac') cisc { cisc { 4>4) ) rcs.wrgtcBcjd(4>4 rcs.wrgtcBcjd( 'pjac `ft lfu`d') rcs.c`d('pjac rcs.c`d( lfu`d') } }) scrvcr.igstc`(5>>>) scrvcr.igstc`(5>>> )

Agờ  h  hẪ` ebẪy iẪg scrvcr vî tbử  trë`  trë` tré`b duyềt `bỦ `a `a SXI sju;   bttp;//ifejibfst;5>>>   bttp;//ifejibfst;5>>>/jhfut   bttp;//ifejibfst;5>>>/ef`tjet

  

Tuy `bgë`, Ěèy ebệ iî mé`b iîm ví dợ Ěƪ` agấ` Ěễ   hhẪ` bgễu bƪ` vỊ rcqucst vî rcspf`sc gl-cisc tb tbôg. Eø` sju `îy, vở g dỺ  ê`  ê` tbỺ e tẶ  tbé `aƾờ g tj obô`a d÷`a ogễ u gl-cisc  tbẶ  `îy Ěèu. Iûe Ěõ hẪ` sẽ aằp obêg `gềm Xfutcr. Uử  d  dợ`a rfutcr Ěễ  ĚgỊu bƾở `a `a trj`a wch. Tả t `bgë`, ebu`a tj sẽ tém bgễ u rfutcr Ỗ  pb  pb ạ` sju eỡj euỚ ` sêeb.  

Trj`a :8

 

Mé`b muỚ` ró bƪ` vỊ ĚfẪ` efdc `îy; ) rcs.wrgtcBcjd(4>4) rcs.wrgtcBcjd(4>4

Obg eõ mỗt rcqucst tở g scrvcr vî scrvcr pbấ` b ổg iẪg rcqucst Ěõ. \ở g rcqucst vjigd, scrvcr sMå b ổg må . Eø` `Ặ  vîf u itb trấ v `a. ẽ pb ốg tbé t÷y ốgễ mî  Ịấ må ốg tƾƪ`a ủ `a. Ěƾụe quy8>>-FO  Ěỏ`b tbcf ầu` aeằỡpj iBTT^. iốgấ` ebu Eêe hẪog ` ễ  eõ  tbjm  tbjm ob f Ỗ  iĚèy .  Eêe hẪ` eõ tbễ  og  ogễ m trj må trấ v Ị tữ  scrvcr  scrvcr hẺ`a eêeb; MỖ  tré`b  tré`b duyềt (Ebrfmc ebẵ`a bẪ`), tém ĚẶ` Dcvcifpcr tffis `bƾ bé`b vẽ. Uju Ěõ ebọ` tjh @ctwfro

Bé`b :.4; Dcvcifpcr tffis trf`a tré`b duy ềt Ebrfmc

bttp;//ifejibfst;5>>>   Uju Ěõ hẪ` truy eập vîf mỗt SXI ebẵ`a bẪ`; bttp;//ifejibfst;5>>>

 

Trj`a :5

 

Bé`b :.3; Ogễ m trj stjtus efdc 8>> - FO

Eø` `Ặ u hẪ` truy eập mỗt SXI obô`a t ổ  ổ` tẪg, `bƾ ĚfẪ` efdc trë` tbé sẽ trấ v Ị iốg 4>4

Bé`b :.4 - @ft Lfu`d

Tõm iẪg, vởg ĚfẪ` efdc trë`, ebû`a tj Ěj`a vgẶ t mỗt bîm Kjvjsergpt Ěƪ` iế Ěễ   iiẦ`a `abc `bỦ `a `a rcqucst tữ  eigc`t `bƾ hrfwscr, mfhgic bjy hả t oễ  eigc`t  eigc`t `îf obêe s ử   d dợ`a J^G. Ebû`a tj aọg bîm `îy iî mỗt rcqucst bj`dicr (xử  iý  iý rcqucst). Eủ  obg eõ rcqucst ĚẶ ` `,,  ổg trấ oẶ t quấ v Ị ebf eigc`t. bîm `îy sẽ tém ogẶ m vî xử  iý  iý r ổ Tả t eấ ủ `a `a dợ`a @fdc.ks ĚỊu bfẪt Ěỗ`a tbcf eƪ ebẶ  `bƾ vậy. Mỗt sg`aic rcqucst bj`dicr Ěễ   xxử  iý  iý tả t eấ eêe rcqucst vî pbấ` b ổg eêe rcqucst Ěõ. \ở g eêe ủ `a `a dợ`a `bỆ tbé ĚgỊu `îy eõ vế Ěƪ` agấ`. @bƾ`a vở g ủ `a `a dợ`a iở `, `, pbấg xử  iý  iý rả t `bg Ịu  Ịu rcqucst, ebƾj oễ   Ěễ  eõ  eõ oẶ t quấ pbấ` b ổg tbé eŧ`a mả t `bg Ị  Ịu tbờg agj` `bƾ; rc`dcr BTMI, upifjd/dfw`ifjd ấ`b... Ğễ   ag agấg quyẶ t `bỦ `a `a vả` ĚỊ `îy ebû`a tj e ạ` sỺ   tr trụ  agûp  agûp eỡj eô`a eợ. ^b ạ` tgẶ p tbcf eỡj euỚ ` sêeb, ebû`a tj sẽ e÷`a `bju xcm CxprcssKU agấg quyẶ t vả` ĚỊ `îy `bƾ tbẶ  `îf.  `îf.  

Trj`a :4

 

^B Ậ@ 8

Agởg tbgều vỊ @^M vî Cxprcss

T

rf`a ĚfẪ` efdc mg`b bọj eỡj pb ạ` :, ebû`a tj bfî` tfî` sử   ddợ`a `bỦ `a `a Ịu pjeojacs pjeojac hugid -g` eỡj @fdc.ks, ví dợ; bttp, ls... Trf`a obg Ěõ, eõ rả t `bg  Ị Ěƾụ e pbêt trgễ ` hỖ g eêe `bî pbêt trgễ ` hë` tbủ  hj  hj mî hẪ` eõ tbễ  s  sử   d dợ`a ebf dỺ   ê` eỡj hẪ`. @bỦ`a pjeojacs `îy Ěƾụe iƾu trỦ  trë`  trë` wchsgtc `pmks.efm (bé`b 8.:). Trj`a wch `pmks.efm eõ tbễ  bg  bgễu `bƾ mỗt mjroct eêe pjeojacs, `ƪg mî hẪ` eõ tbễ  tbj  tbj b ổ iỺ j ebọ` pjeojac `îf pb÷ bụ p vở g dỺ  ê` Ěễ  s  sử  d  dợ`a. Eø` @^M (@fdc ^jeojac Mj`jacr) iî pb ạ` m Ịm Ěƾụe eîg Ěằt e÷`a vở g @fdc.ks, `õ Ěƾụe d÷`a Ěễ  qu  quấ` iý eêe pjeojacs mî hẪ` dfw`ifjd tữ  `pmks.efm.  `pmks.efm.

Bé`b 8.:; agjf dgề` trj`a wch `pmks.efm 

Eîg Ěằt Eustfm ^jeojac vở g @^M Ğễ  eîg Ěằt mỗt pjeojac tữ  `pmks.efm,  `pmks.efm, hẪ` tém ogẶ m pjeojac tữ   b bỗp scjreb, sju obg ebọ` Ěƾụ e mỗt pjeojac eõ vế ƾ`a ý. HẪ` ebọ` pjeojac Ěõ vî `bé` eêe tbô`a tg` mỗt pjeojac `bƾ bé`b hë` dƾở gg..

 

Trj`a :3

 

Bé`b 8.8; Trj`a tbô`a tg` m ỗt mfduic trë` `pmks.efm

Ố  Ěèy `bé` vîf tbô`a tg` eêeb eîg Ěằt, bọ eõ abg ró i ề`b eîg Ěằt pjeojac `îy hẺ`a `pm; \í dợ iề`b eîg Ěằt pjeojac cjsy-pjsswfrd-ac` `bƾ bé`b 8.8  `pm g cjsy-pjsswfrd-ac` cjsy-pjsswfrd-ac`

Trf`a euỚ ` sêeb `îy, mé`b agở g tbgều vở g eêe hẪ` mỗt pjeojac quj` trọ`a vî eŧ`a rả t pbồ hgẶ ` trf`a tbẶ   ag agởg @fdc.ks, Ěõ iî CxprcssKU. HỖ g vé eû pbêp J^G eỡj @fdc.ks eõ tbễ   dîg dø`a, obõ bgễ u vî agở g bẪ` v Ị tí`b `ą`a, `ë` `aƾờ g tj hẦt Ěạu `abħ tở g mỗt lrjmcwfro agûp bọ Ěƪ` agấ` bõj quê tré`b vgẶ t ủ `a `a dợ`a. CxprcssKU iî mỗt Lrjmcwfro `bỆ, `bƾ`a ig`b bfẪt Ěƾụ e xèy dỺ `a `a trë` ` Ị` tấ`a eỡj @fdcks. @õ eu`a eảp eêe tí`b `ą`a mẪ`b mẽ Ěễ  pbêt  pbêt trgễ ` ủ `a `a dợ`a wch. Ebû`a tj sẽ  tbảy CxprcssKU iîm Ěƪ` agấ` bõj eêe J^G eỡj @fdc.ks, eêeb tồ ebủ e dỺ  ê`  ê` tbcf mô bé`b M\E vở g mgddicwjrc vî rfutg`a. @afîg rj eø` bî`a tê `bỦ `a `a bîm Stgis r ả t bỦu íeb Ěễ   xử  iý  iý BTT^ vî rc`dcr BTMI.

Ğễ  eîg Ěằt CxprcssKU, eêe hẪ` aó; `pm g`stjii cxprcss 

Trƾở e obg hẪ` eõ tbễ  eb  ebẪy eèu iề`b eîg Ěằt cxprcss `bƾ trë`, dỺ  ê`  ê` eỡj hẪ` e ạ` pbấg tẪf trƾở e pjeojac.ksf`  pjeojac.ksf`.. Ğèy iî lgic eả u bé`b eỡj dỺ  ê`, iƾu trỦ   ttả t eấ eêe tbô`a tg` v Ị dỺ  ê`  ê` `bƾ; të` dỺ  ê`, vcrsgf`, eêe pjeojacs Ěƾụ e sử  d  dợ`a trf`a dỺ  ê`...  ê`... @Ặ u hẪ` ebẪy iề`b `pm g`stjii cxprcss mî obô`a eõ pjeojac.ksf` tbé s ẽ aằp iốg; "`f "`f sueb lgic fr dgrcetfry, fpc` … pjeojac.ksf` c.ksf`". ".

 

Trj`a :<

 

Ğễ  ac`crjtc  ac`crjtc rj lgic pjeojac.ksf` lgic pjeojac.ksf`,, hẪ` dg ebuyễ ` ef` trỆ vîf tbƾ mợe dỺ  ê`,  ê`, aó iề`b; `pm g`gt

Uju Ěõ hẪ` ĚgỊ` eêe tbô`a tg` `bƾ trf`a bƾở `a `a dắ` eỡj tré`b tbuật sħ. Uju obg bfî`  pjeojac.ksf`   tbî`b, hẪ` aó "Wcs" Ěễ  xêe  xêe `bậ` tẪf pjeojac.ksf`  pjeojac.ksf` mî \í dợ Ěèy iî pjeojac.ksf`  mî mé`b tẪf ebf dỺ  ê`  ê` ebf pb ạ` 8 eỡj euỚ ` sêeb `îy. { "`jmc"; "ebjp8", , "`jmc"; "ebjp8" "vcrsgf`" "vcrsgf`"; ; ":.>.>", ":.>.>", "dcsergptgf`"; "dcsergptgf`"; "Efdc mg`b bọj ebf ebjp 8" , "mjg`"; "g`dcx.ks", , "mjg`"; "g`dcx.ks" "sergpts"; "sergpts"; { "tcst" "tcst"; ; "cebf Y"Crrfr; `f tcst spceglgcdY" && cxgt :" :"    }, "jutbfr"; ; "\@[email protected]", "\@[email protected]", "jutbfr" "igec`sc" "igec`sc"; ; "GUE"  "GUE"  }

cxprcss. Obg vgềe eîg Ěằt oẶ t tbûe, hẪ` TgẶ p tbcf, hẪ` aó iề`b eîg Ěằt cxprcss; `pm g`stjii cxprcss.  pjeojac.ksf` tbëm cxprcss  `bƾ hë` dƾở gg.. sẽ tbả y pjeojac.ksf`  tbëm mỗt dcpc`dc`egcs  dcpc`dc`egcs iî cxprcss { "`jmc" "`jmc"; ; "ebjp8" "ebjp8", , "vcrsgf`"; ; ":.>.>", ":.>.>", "vcrsgf`" "dcsergptgf`"; "Efdc mg`b bọj ebf ebjp 8" , "dcsergptgf`"; "mjg`"; "g`dcx.ks" "mjg`"; "g`dcx.ks", , "sergpts"; "sergpts"; { "tcst" ; "cebf Y"Crrfr; `f tcst spceglgcdY" && cxgt :"  "tcst"; :"   }, "jutbfr"; ; "\@[email protected]", "\@[email protected]", "jutbfr" "igec`sc" "igec`sc"; ; "GUE", "GUE", "dcpc`dc`egcs" "dcpc`dc`egcs"; ; { "cxprcss"; "P4.:1.:"  "cxprcss"; "P4.:1.:"  } }

dcpc`dc`egcs s Tbế dcpc`dc`egcs  sẽ ebủ j tả t eấ të` eỡj eêe pjeojacs e÷`a vởg vcrsgf` iûe eîg Ěằt. TẪg tbờg Ěgễ m eỡj euỚ ` sêeb `îy tbé vcrsgf` mở g `bả t eỡj cxprcss iî 4.:1.:. @afîg rj, tfî` hỗ må `au ổ` eỡj pjeojac cxprcss sju obg Ěƾụe eîg Ěằt sẽ Ěƾụe iƾu tẪg tbƾ mợe `fdcVmfduics (Bé`b `fdcVmfduics  (Bé`b 8.5)

 

Trj`a :1

 

Ỻ   ê` Bé`b 8.5; `ƪg ebủ j må `auổ` cxprcssKU trf`a d Ỻ ê`

`fdcVmfduics tbé HẪ` mỖ  tbƾ mợe `fdcVmfduics  tbé tbảy `afîg tbƾ mợe eõ të` cxprcss tbé eø` eõ r ả t `bg Ịu  Ịu tbƾ mợe obêe `Ủ j. j. Mằe d÷ iûe trƾở e hẪ` mở g ebệ eîg mốg mỗt mé`b CxprcssKU. @auyë` `bè` iî df CxprcssKU eõ s ử  d  dợ`a eêe dcpc`dc`egcs obêe, `ë` obg eîg Ěằt CxprcssKU tbé `pm eŧ`a sẽ tấg vî eîg Ěằt ebû`a iuô`. Ğễ   hg hgẶt Ěƾụ e cxprcss eõ `bỦ `a `a dcpc`dc`egcs `îf tbé hẪ` iẪg vîf pjeojac eỡj CxprcssKU iî sẽ tbả yy.. Tuy `bgë`, hẪ` obô`a `ë` sử j hả t oé dø`a efdc trf`a tbƾ mợe `fdcVmfduics. \é Ěèy iî må `au ổ` aỚ e eỡj pjeojac, hẪ` sẽ obô`a hgẶt Ěƾụ e sẽ pbêt sg`b iốg aé `Ặ u sử j ebû`a Ěèu. 

Agở g tbgều Cxprcss Ố  pb  pb ạ` `îy, mé`b sẽ agở g tbgều `bg Ịu  Ịu bƪ` vỊ CxprcssKU, tẪg sjf `õ iẪg agûp pbêt trgễ ` ủ `a `a dợ`a @fdc.ks Ěƪ` agấ` vî `bj`b bƪ`.  Ğạu tgë`, ebû`a tj sẽ gmpfrt cxprcss cxprcss vîf  vîf ủ `a `a dợ`a hẺ`a eêeb tbëm ĚfẪ` efdc sju vîf g`dcx.ks;; g`dcx.ks  

Trj`a :2

 

ef`st cxprcss rcqugrc('cxprcss') ) ef`st cxprcss = rcqugrc('cxprcss'

Ğễ  eõ  eõ tbễ  sf  sf sê`b vî oẶ t iuậ` tẪg sjf CxprcssKU iẪg agûp pbêt trgễ ` ủ `a `a dợ`a `bj`b bƪ`, ebû`a tj sẽ vgẶ t iẪg `bỦ `a `a aé Ỗ  pb  pb ạ` : euỚ` sêeb, `bƾ`a vở g sỺ   tr trụ  agûp  agûp eỡj CxprcssKU. ef`st bttp rcqugrc( 'bttp')? )? ef`st bttp = rcqugrc('bttp' ef`st ef`st scrvcr  scrvcr = bttp.ercjtcUcrvcr((rcqucst, rcspf`sc) =0 { =0 { ef`sfic.ifa("xg` ef`sfic.ifa( "xg` ebjf \@[email protected]")? \@[email protected]")? }) scrvcr.igstc`(5>>>) scrvcr.igstc`(5>>> )

@bƾ`a vở g CxprcssKU tbé hẪ` ebệ e ạ` `bƾ sju;  ef`st cxprcss  cxprcss = rcqugrc('cxprcss' rcqugrc('cxprcss') ) ef`st ef`st jpp ef`st jpp = cxprcss() jpp.igstc`(5>>> jpp.igstc`( 5>>>, , () =0 =0{ { "Jpp igstc`g`a f` pfrt 5>>>") ef`sfic.ifa("Jpp ef`sfic.ifa( 5>>>" ) })

HẪ` tbảy Ěả y, y, ebû`a tj obô`a e ạ` pbấg gmpfrt tbëm hả t eủ  pjeojac  pjeojac `îf eấ, eŧ`a obô`a e ạ` pbấg vgẶt ĚfẪ` xử  iý  iý rcqucst bjy rcspf`sc ` Ủ j. j. \ Ị hấ` ebả t tbé CxprcssKU if iîm agûp vgềe gmpfrt eêe pjeojac e ạ` tbgẶ t ebf ebû`a tj r  ổ ổg, ebû`a tj obô`a e ạ` pbấg iîm `Ủ j. j. Tuy `bgë`, `Ặ u ebệ Ěƪ` agấ` iî rût aọ` efdc tbé CxprcssKU iẪg quê hé`b tbƾờ `a `a pbấg obô`a6 CxprcssKU obô`a Ěƪ` agấ` `bƾ vậy Ěèu. 

Rử  iý  iý rcqucst vở g Cxprcss CxprcssKU ebf pbçp xử  iý  iý ig`b bfẪt bƪ` vở g eêe rcqucst "ACT" bjy "^FUT" tữ  tré`b  tré`b duyềt. Dƾởg Ěèy iî mg`b bọj eêeb ủ `a `a dợ`a trấ v Ị mỗt ĚỚg tƾụ `a `a KUF@ obg `bậ` Ěƾụ e mỗt rcqucst; ef`st cxprcss  cxprcss = rcqugrc('cxprcss' rcqugrc('cxprcss') ) ef`st ef`st jpp = cxprcss() ef`st jpp jpp.igstc`(5>>> jpp.igstc`( 5>>>, , () =0 =0{ { ef`sfic.ifa("Jpp ef`sfic.ifa( 5>>>" ) "Jpp igstc`g`a f` pfrt 5>>>") }) jpp.act("/", jpp.act("/" , (rcqucst, rcspf`sc) =0 =0{ { rcspf`sc.ksf`({ `jmc; "Duf`a J`b Uf`", Uf`", wchsgtc; "\@[email protected]"  "\@[email protected]"  }) })  

Trj`a :7

 

Trf`a ĚfẪ` efdc trë`, hẪ` eõ tbễ  tb  tbả y iî CxprcssKU eu`a eả p `bg  Ị Ịu iỺ j ebọ` bƪ` Ěễ   hẪ` eõ tbễ  pb  pbấ` b ổg iẪg `bỦ `a `a rcqucst tữ  tré`b  tré`b duyềt. \í dợ, ebû`a tj trấ v Ị ĚỚg tƾụ `a `a rcspf`sc.ksf`(). @b KUF@ ebf tré`b duyềt hẺ`a bîm rcspf`sc.ksf`().  @bờ  ĚgỊu `îy mî ebû`a tj dể dî`a xèy dỺ `a `a eêe XCUT J^G vở g @fdc.ks. @afîg rj, ebû`a tj eõ tbễ  Ěỏ`a `abħj `bỦ `a `a rfutcs eợ tbễ , ví dợ `bƾ;  , (rcqucst, rcspf`sc) =0 =0{ { jpp.act("/jhfut", jpp.act("/jhfut" rcspf`sc.ksf`({ `jmc; "Duf`a J`b Uf`" Uf`", , wchsgtc; "\@[email protected]"  "\@[email protected]"  }) })

Eêg `îy `aƾờ g tj aọg iî Xfutg`a. Tủ e bgễu `ôm `j iî ebû`a tj quy ƾở e pb ạ` xử  iý  iý vở g mỗt SXI eợ tbễ  `îf Ěõ. @bƾ Ỗ  pb  pb ạ` :, Ěễ   xxử  iý  iý `bỦ `a `a SXI rgë`a hgềt, ebû`a tj pbấg `bờ  ĚẶ ` gl-cisc trf`a mỗt bîm xử  iý  iý rcqucst iở ` `.. ef`st ef`st scrvcr  scrvcr = bttp.ercjtcUcrvcr((rcq, bttp.ercjtcUcrvcr((rcq, rcs) =0 =0 {  { gl (rcq.uri '/jhfut') gl (rcq.uri === '/jhfut') rcs.c`d('Tbc rcs.c`d( pjac') 'Tbc jhfut pjac') gl (rcq.uri  (rcq.uri === '/ef`tjet' '/ef`tjet') ) cisc gl 'Tbc ef`tjet pjac') rcs.c`d('Tbc rcs.c`d( pjac') gl (rcq.uri === '/' cisc gl (rcq.uri '/') ) rcs.c`d('Tbc rcs.c`d( pjac') 'Tbc bfmc pjac') cisc { cisc { 4>4) ) rcs.wrgtcBcjd(4>4 rcs.wrgtcBcjd( rcs.c`d('pjac rcs.c`d( lfu`d') 'pjac `ft lfu`d') } })

\ở g CxprcssKU tbé hẪ` eõ tbễ  têeb  têeb rgë`a hgềt ebf tữ `a `a SXI rgë`a hgềt. ĞgỊu `îy agûp tą`a obấ `ą`a mfduic bõj bjy obấ  `ą`a hấf tré dỺ  ê`.  ê`. \ởg ĚfẪ` efdc tbé cxprcss eõ tb ễ  têeb `bƾ sju;  , (rcqucst, rcspf`sc) =0 =0{ { jpp.act("/jhfut", jpp.act("/jhfut" rcs.sc`d('Tbc rcs.sc`d( 'Tbc jhfut pjac' pjac') ) }) , (rcq, rcs) =0 =0{ { jpp.act("/ef`tjet", jpp.act("/ef`tjet" 'Tbc ef`tjet pjac') rcs.sc`d('Tbc rcs.sc`d( pjac') }) jpp.act("/ef`tjet", jpp.act("/ef`tjet" , (rcq, rcs) =0 =0{ {  

Trj`a 8>

 

pjac') ) rcs.sc`d('Tbc ef`tjet pjac' rcs.sc`d('Tbc }) , (rcq, rcs) =0{ =0{ jpp.act("/", jpp.act("/" rcs.sc`d('Tbc rcs.sc`d( pjac') 'Tbc bfmc pjac') }) jpp.act('*', jpp.act('*' , lu`etgf` lu`etgf`(rcq, (rcq, rcs){ 4>4) ) rcs.bcjdcr(4>4 rcs.bcjdcr( 'pjac `ft lfu`d' lfu`d') ) rcs.sc`d('pjac rcs.sc`d( })?

Hảt Ěổ`a hỗ vở g Ejii Hjeo Trf`a `bỦ`a ĚfẪ` efdc trë`, hẪ` Ěå hẦt aằp vgềe sử   d dợ`a eêe bîm ejii hjeo. Ejii Hjeo iî mỗt obêg `gềm vô e÷`a quj` trọ`a trf`a @fdc.ks, Ěƾụ e sử   d dợ`a Ěễ   xxử  iý  iý eêe bîm hả t Ěổ`a hỗ.  tủ esiî bîm sju Ğổ`a Ặ et bg tbé eêehỗ bîm ẽ i ạ`  eêe ạ` iƾụ  t tbvgỺ  ề`;sẽ Ěụ g bîm vgẶt trƾở e bfî` tbî`b. \í dợ `bƾ trf`a ^B^ Tjso : -0 Tjso 8 -0 Tjso 5 -0 Tjso 4 -0 Efmpictgf`

@bƾ vậy, `Ặ u tjso : tbỺ e bgề` quê ièu bfằe hỏ hifeo vé iý df `îf Ěõ tbé bîm tjso sẽ  obô`a tbễ  tb  tbỺ e bgề`. \ởg @fdc.ks tbé bƪg obêe, `õ ebf pbçp eêe bîm Ěƾụ e tbỺ e bgề` hả t Ěổ`a hỗ, tủ e iî bîm sju obô`a e ạ` pbấg Ěụg bîm trƾở e tbỺ e bgề` xf`a. Tả t eấ sẽ Ěƾụ e ebf vîf mỗt qucuc, eêg `îf xf`a trƾở e tbé tbô`a hêf. \í dợ ĚfẪ` efdc sju trf`a @fdc.ks //Tjso: //Tjso:    jpp.act('/' jpp.act( '/', , (rcq, rcs) =0 { =0 { // qucry djtjhjsc djtjhjsc    }) //Tjso8  //Tjso8  jpp.act('/jhfut' jpp.act( '/jhfut', , (rcq, rcs) =0 =0 {  { rcs.sc`dLgic(pjtb.rcsfi rcs.sc`dLgi c(pjtb.rcsfivc(VVdgr`jmc vc(VVdgr`jmc, , 'jhfut.btmi')) 'jhfut.btmi')) })

Obg hẪ` ebẪy ebƾƪ`a tré`b, eấ 8 tjso ĚỊu sẽ Ěƾụ e tbỺ e bgề` e÷`a mỗt tbờg Ěgễ m. m. @Ặ u tjso : mî e ạ` `bg Ị  Ịu tbờ g agj`, mî tjso 8 iẪg Ěƪ` agấ` ebệ aử g mỗt lgic tħ`b ebf tré`b duyềt tbé obấ `ą`a tjso sẽ tbỺ e bgề` xf`a trƾở e. e. Eấ 8 tjso e÷`a hẦt Ěạu mỗt tbờg Ěgễ m `bƾ`a obô`a eõ `abħj ebû`a sẽ tbỺ e bgề` Ěổ`a tbờ g.g. Obg mỗt tjso e ạ` tbờ g agj` tbé tjso sẽ  e tbỺ e bgề`. \î obg mỗt tjso tbỺ e bgề` xf`a tbé sử   d dợ`a ejii hjeo Ěễ  tbô`a  tbô`a hêf ebf Ěƾụ  ebƾƪ`a tré`b hgẶ t.t.  

Trj`a 8:

 

\ Ị iý tbuyẶt tbé ebƾƪ`a tré`b hảt Ěổ`a hỗ sẽ ebẪy `bj`b bƪ` vé tậ` dợ`a Ěƾụ e tbờ g agj` `bî` rốg eỡj E^S.

Trấ v Ị mỗt lgic btmi ebf eigc`t sc`dLgic jpg. Ğễ  pbî`  pbî` b ổg iẪg eigc`t mỗt lgic btmi trf`a CxprcssKU, h Ẫ` sử   d dợ`a sc`dLgic  jpg. Eêeb iîm

`bƾ sju;  g`    // ejiicd wbc` rcqucst tf '/jhfut' efmcs g` jpp.act('/jhfut' jpp.act( '/jhfut', , (rcq, rcs) =0 =0 {  { rcs.sc`dLgic(pjtb.rcsfiv rcs.sc`dLgic (pjtb.rcsfivc(VVdgr`jmc c(VVdgr`jmc, , 'jhfut.btmi')) 'jhfut.btmi')) }) //ejiicd wbc` rcqucst tf '/ef`tjet' efmcs  efmcs  jpp.act('/ef`tjet' jpp.act( '/ef`tjet', , (rcq, rcs) =0 =0 {  { rcs.sc`dLgic(pjtb.rcsfiv rcs.sc`dLgic (pjtb.rcsfivc(VVdgr`jmc c(VVdgr`jmc, , 'ef`tjet.btmi')) 'ef`tjet.btmi')) })

@bƾ ví dợ trë`, mêy ebỡ `fdc.ks sẽ trấ v Ị ebf eigc`t tềp jhfut.btmi obg `õ rcqucst t ở g  /jhfut Trf`a eêe ví d ợ v ữ   d ợ`a bîm jpp.act('...') Ěễ   x  x ử  iý eêe yëu ữ j quj mé`b sử  d  ử  iý eạu BTT^ ACT. ACT iî if Ẫg rcqucst Ěƾụe quy ƾởe d÷`a Ěễ  truy  truy eậ p vîf bé`b ấ`b... mî obô`a tbjy Ěồ g `ỗg du`a scrvcr Ěễ  i iả  y tbô`a tg`, tîg `auyë`, bé`b  pbíj scrvcr. @afîg @afîg ACT rj, BTT^ eø` Ěỏ`b `ab `abħj ħj eêe ifẪg rcqucst obêe `bƾ ^FUT, DCICTC, S^DJTC. Ebû`a tj sẽ tém bgễ u ebû`a d ạ` d ạ` trf`a eêe pbạ` sju eỡj euỚ ` sêeb.

Trấ v Ị stjtge rcsfurec (gmjac, ess, ks...) ebf eigc`t \ở g eêe ủ `a `a dợ`a wch, vgềe pbấg sử  d  dợ`a gmjac, ess, ks iî ĚgỊ u a ạ` `bƾ hẦt huỗe Ěễ   `a dợ`a. @bƾ`a mằe Ěỏ`b tbé tả t eấ eêe tîg `auyë` Ěỏ`b dẪ`a, trj`a trí agjf dgề` ebf ủ `a trë` mêy ebỡ ĚỊu Ěƾụ e hấf mật, `Ặ u obô`a eõ quy Ị` tbé eigc`t obô`a tbễ  truy  truy eập Ěƾụ e e,, bfằe ít `bả t pbấg truy eập quj eêe rfutcr. Eõ mỗt agấg pbêp pbồ hgẶ ` iî ebû`a tj sẽ Ěƾj bẶ t eêe lgic stjtge (gmjac, ess, ks...) vîf mỗt tbƾ mợe, aọg iî puhige. Tbƾ mợ e puhige eõ tbễ  truy  truy eập tữ   h hả t oỵ Ěèu, jg eŧ`a eõ tbễ   truy eập Ěƾụ e, e, ebệ hgẶt Ěƾờ `a `a dắ` eỡj `õ. Trf`a Cxprcss, hẪ` dể dî`a Ěỏ`b `abħj mỗt tbƾ mợe puhige `bƾ tbẶ . ef`st ef`st cxprcss  cxprcss = rcqugrc('cxprcss' rcqugrc('cxprcss') ) ef`st jpp ef`st jpp = cxprcss() ef`st pjtb = rcqugrc('pjtb' ef`st pjtb rcqugrc( 'pjtb') )  

Trj`a 88

 

jpp.usc(cxprcss.stjtge('puhige' jpp.usc(cxprcss.stjtge( 'puhige')) )) , () =0 =0 {  { jpp.igstc`(5>>>, jpp.igstc`(5>>> ef`sfic.ifa("Jpp ef`sfic.ifa( 5>>>") "Jpp igstc`g`a f` pfrt 5>>>") })

Agờ  iîm  iîm ví dợ mg`b bọj, mé`b Ěƾj mỗt tềp ấ`b v`tjiog`a.p`a vîf tbƾ mợe puhige `bƾ dƾởg Ěèy. 

Bé`b 8.4; Tbƾ mợe puhige d÷`a Ěễ  eb  ebủ j stjtge rcsfurec

bttp;//ifejibfst;5>>>/v`tjiog`a.p`a . . Agờ  h  hẪ` eõ tbễ  truy  truy eập trỺ e tgẶ p trë` tré`b duyềt bttp;//ifejibfst;5>>>/v`tjiog`a.p`a HẪ` tbảy Ěả y, y, ebû`a tj obô`a e ạ` pbấg Ěỏ`a `abħj rfutcr Ěễ  truy  truy eập vîf lgic ấ`b Ěõ.  HẪ` eõ tbễ   ssử   d dợ`a eêe tềp trf`a tbƾ mợe puhige trf`a eêe lgic btmi mî obô`a pb ấg tbô`a quj rfutcr. //jhfut.btmi 9b:0Ğèy iî mî` bé`b tbô`a tg` vỊ \@[email protected] 9/b:0 9/b:0    9gma sre sre= ="/v`tjiog`a.p`a" styic styic= ="wgdtb; 5>%"/0 5>%"/0   

\î tbử  vîf  vîf tré`b duyềt ogễ m trj tbử .

Bé`b 8.3; Mg`b bọj truy eậ p stjtge rcsfurec rcsfurec  

Trj`a 85

 

Eêm ƪ` hẪ` Ěå quj` tèm tở g sêeb bọe iập tré`b @fdc.ks tbật Ěƪ` agấ`. Mờ g hẪ` truy eập \@[email protected]  \@[email protected] Ěễ  Ěằt muj hấ` sêeb Ěạy Ěỡ `bç. Ğằe hgềt ƾu Ěåg ebf eêe hẪ` bọe sg`b - sg`b vgë`.

 

Trj`a 84

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF