Goals
- Learn to use NodeJs and create a server
Program
Presentation of node versions
Principle of a Web server
Comparison between server
JavaScript reminders
Workshop: Download and install NodeJS
Manage node versions (nvm vs n)
The interest of javascript on the server side
Testing commands with REPL
The single-threaded event loop
The non-blocking API
The Google V8 engine
Workshop: Running the first scripts with REPL
Emmascript history Strict
mode overview Ecmascript
support in NodeJS (node.green)
Presentation and description
npm: node package manager
Presentation of the module library
Include modules in a project: require
Local or global installation
The package.json file
Manage dependencies (production and development)
npm and npx
Add scripts
Create and publish a module
Workshop: Testing npm
The Node API documentation
The Process classes: events, flows, etc.
Use standard outputs (stdin, stdout, stderr)
Global, Console (log, errors, trace), Buffer, Streams
variables __filenames and __dirnames Capture
and broadcast
Les Timers events
Read and write files
Manage paths and urls
Create, delete, rename files and folders
List the contents of a file
Workshop: handling files
Presentation of callbacks (callback function)
Principle of Promises
Callbacks vs Promises
Implementation of promises
Transformation of a callback function into a promise
Async / await functions
Workshop: Using promises
The « http »
Request and Response module
Modify the headers
Parse a url
Display a message on the browser
Manage static pages
Add a template engine
Retrieve the request and form parameters
Workshop: Create a server
Presentation of « Express »
Create an Express project
Middleware
Manage http verbs
Morgan, Helmet, etc. modules
Encrypt data with bcrypt
Workshop: Using Express
Connect to SQL and NoSQL databases
Retrieve a DBMS connector
Execute queries and retrieve results
ORMs and ODMs: sequelize and Mongoose
Workshop: Connect a database
Debug our pages using chrome
Use the code inspector (–inspect)
Presentation of Mocha
Assertions in NodeJS: assert
The Chai module
Synchronous and asynchronous tests
Hooks
Workshop: Launch several tests
Workshop : Set up a REST API with authentication
Duration
4 days
Price
£ 2154
Audience
Javascript Developers
Prerequisites
Good knowledge of javascript and ecmascript standards
Reference
SIT100450-F
Sessions
Contact us for more informations about session date