Skip to content

Latest commit

ย 

History

History
69 lines (39 loc) ยท 3.01 KB

README.md

File metadata and controls

69 lines (39 loc) ยท 3.01 KB

ืชื™ืขื•ื“ ืœืืคืœื™ืงืฆื™ื™ืช ืฆื™ื•ืจ ืขืœ ืœื•ื— ืžื—ื™ืง ื‘ื–ืžืŸ ืืžืช ื‘-Node.js ๐Ÿ–‹๏ธ๐Ÿ“„๐Ÿ–Œ๏ธ

ืžื‘ื•ื:

ื”ืืคืœื™ืงืฆื™ื” ื”ื™ื ืœื•ื— ืฆื™ื•ืจ ืฉื™ืชื•ืคื™ ื‘ื–ืžืŸ ืืžื™ืชื™ ืฉืžืžื•ืžืฉ ื‘ืืžืฆืขื•ืช Node.js, Express.js ื•-Socket.IO. ื”ื™ื ืžืืคืฉืจืช ืœืžืฉืชืžืฉื™ื ืžืจื•ื‘ื™ื ืœืฆื™ื™ืจ ืขืœ ืงื ื‘ืก ืžืฉื•ืชืฃ, ืœืขื“ื›ืŸ ืืช ื”ืฆื™ื•ืจื™ื ืฉืœื”ื ืœื›ืœ ื”ืžืฉืชืžืฉื™ื ื”ืื—ืจื™ื ื‘ื–ืžืŸ ืืžื™ืชื™ ื•ืœื ืงื•ืช ืืช ื”ืงื ื‘ืก ื›ืฉืฆืจื™ืš.

ื“ืจื™ืฉื•ืช:

ื›ื“ื™ ืœื”ืจื™ืฅ ืืช ื”ืืคืœื™ืงืฆื™ื” ื™ื”ื™ื” ืฆื•ืจืš ื‘:

  • Node.js
  • npm (ื‘ื“ืจืš ื›ืœืœ ืžื’ื™ืข ืขื Node.js)
  • ื’ื™ืฉื” ืœืžืžืฉืง ืฉื•ืจืช ื”ืคืงื•ื“ื” ืื• ืœื˜ืจืžื™ื ืœ

ืชืœื•ื™ื•ืช:

ื”ืืคืœื™ืงืฆื™ื” ืžืกืชืžื›ืช ืขืœ ื”ืชืœื•ื™ื•ืช ื”ืจืืฉื™ื•ืช ื”ื‘ืื•ืช:

  • Express.js ืœืฉื™ืจื•ืช ืงื‘ืฆื™ื ืกื˜ื˜ื™ื™ื ื•ื˜ื™ืคื•ืœ ื‘ื‘ืงืฉื•ืช HTTP.
  • Socket.IO ืœืืคืฉืจ ืชืงืฉื•ืจืช ื“ื•-ื›ื™ื•ื•ื ื™ืช, ืžื‘ื•ืกืกืช ืื™ืจื•ืขื™ื ื•ื‘ื–ืžืŸ ืืžื™ืชื™.
  • ืจื›ื™ื‘ fs (ืžืขืจื›ืช ืงื‘ืฆื™ื) ืœืงืจื™ืื” ื•ื›ืชื™ื‘ื” ืฉืœ ืžืฆื‘ ื”ืœื•ื— ืœืงื•ื‘ืฅ.

ื”ื’ื“ืจื” ืžืงื•ืžื™ืช ื•ื”ืจืฆืช ื”ืืคืœื™ืงืฆื™ื”:

ื•ื“ื ืฉื”ืชืงื ื•ืช Node.js ื•-npm ืžื•ืชืงื ื™ื ื‘ืžื—ืฉื‘ ืฉืœืš ืขืœ ื™ื“ื™ ื”ืจืฆืช:

node --version
npm --version

ื”ืขืชืง ืืช ื”ืงื•ื“ ืื• ื”ื•ืจื“ ืืช ืงื•ื“ ื”ืžืงื•ืจ ืœืžื—ืฉื‘ ื”ืžืงื•ืžื™ ืฉืœืš.

ื ื•ื•ื˜ ืืœ ื”ืชื™ืงื™ื™ื” ื”ืจืืฉื™ืช ืฉืœ ื”ืืคืœื™ืงืฆื™ื” ื‘ื˜ืจืžื™ื ืœ ืื• ื‘ืžืžืฉืง ืฉื•ืจืช ื”ืคืงื•ื“ื” ืฉืœืš.

ื”ืชืงืŸ ืืช ืžื•ื“ื•ืœื™ Node.js ื”ื ื“ืจืฉื™ื ืขืœ ื™ื“ื™ ื”ืจืฆืช:

npm install

ืคืงื•ื“ื” ื–ื• ืชืชืงื™ืŸ ืืช Express.js, http, Socket.IO ื•ืจื›ื™ื‘ fs ื›ืคื™ ืฉืžื•ื’ื“ืจ ื‘ืงื•ื‘ืฅ package.json.

ื”ืชื—ืœ ืืช ื”ืฉืจืช ืขืœ ื™ื“ื™ ื”ืจืฆืช:

node <your-main-js-file>.js

ื”ืขืจื”: ื”ื—ืœืฃ ืืช <your-main-js-file> ื‘ืฉื ืงื•ื‘ืฅ ื”ื›ื ื™ืกื” ื”ืืžื™ืชื™ ืฉืœ ื”ืืคืœื™ืงืฆื™ื” ืฉืœืš ื‘-Node.js, ืœืžืฉืœ app.js ืื• index.js.

ืคืชื— ืืช ื”ื›ืชื•ื‘ืช http://localhost:3000 ื‘ื“ืคื“ืคื ื™ื ืื• ื›ืจื˜ื™ืกื™ื•ืช ืžืจื•ื‘ื•ืช ื›ื“ื™ ืœื‘ื“ื•ืง ืืช ื”ืคื•ื ืงืฆื™ื•ื ืœื™ื•ืช ื‘ื–ืžืŸ ืืžื™ืชื™.

ืคื•ื ืงืฆื™ื•ื ืœื™ื•ืช ื”ืืคืœื™ืงืฆื™ื”:

ืฉื™ืจื•ืช ืงื‘ืฆื™ื ืกื˜ื˜ื™ื™ื: Express.js ืžืฉืจืช ืงื‘ืฆื™ื ืกื˜ื˜ื™ื™ื ื”ื ืžืฆืื™ื ื‘ืชื™ืงื™ื™ื” public.

ื—ื™ื‘ื•ืจ Socket.IO: ื‘ืขืช ื—ื™ื‘ื•ืจ ืžืฉืชืžืฉ, ื”ืฉืจืช ืžืชืขื“ ืืช ื”ืื™ืจื•ืข, ืฉื•ืœื— ืืช ืžืฆื‘ ื”ืœื•ื— ื”ื ื•ื›ื—ื™ ืœืžืฉืชืžืฉ ื•ืžืื–ื™ืŸ ืœืื™ืจื•ืขื™ draw ื•-clear.

ืฆื™ื•ืจ ืขืœ ื”ืœื•ื—: ื›ืืฉืจ ืžืฉืชืžืฉ ืžืฆื™ื™ืจ ืขืœ ื”ืœื•ื—, ื ืชื•ื ื™ ื”ืฆื™ื•ืจ ืžืฉื•ื“ืจื™ื ืœื›ืœ ื”ืžืฉืชืžืฉื™ื ื”ืžื—ื•ื‘ืจื™ื, ื•ืžืฆื‘ ื”ืœื•ื— ืžืชืขื“ื›ืŸ ื•ื ืฉืžืจ ื‘ืงื•ื‘ืฅ.

ื ื™ืงื•ื™ ื”ืœื•ื—: ืื ืžืฉืชืžืฉ ืื•ืชื—ืœ ืื™ืจื•ืข ื ืงื™ื•ืŸ, ื”ืœื•ื— ื ืžื—ืง ืœื—ืœื•ื˜ื™ืŸ, ื”ืื™ืจื•ืข ืžืฉื•ื“ืจ ื•ืžืฆื‘ ื”ืœื•ื— ืœืื—ืจ ืžื›ืŸ ืžืชืืคืก ื•ื ืฉืžืจ.

ื ืจืื•ืช ื”ืืชืจ ื•ื”ืฉื™ืžื•ืฉ ื‘ื•:

Drawing.Board.View.mp4