Call Us: +32 2 466 00 16
Email: info@u2u.be
Follow Us:

Building a Web Server with Node.js

1days
Training code
UNJS

Upcoming sessions

This course is currently not scheduled

Subscribe to waiting list

Introducing Node.js

Most people have heard that node.js allows you to run JavaScript outside of the browser, and even allow you to write a web server in JavaScript. But why? Why not stick to the server-side techniques that we know? This module explains the what and the why of node.js. You'll see that even for a PHP or an ASP.NET developer, node.js will become an indispensable tool.

  • Why Node.js?
  • Event-driven and non-blocking execution environment
  • Understanding and using asynchronous control flows

Modules

Just as famous and useful as node is npm, the Node Package Manager. Npm manages your libraries and metadata of your application.

  • Importing and exporting CommonJS Modules
  • Installing external modules with the Node Package Manager

Creating a basic HTTP server

In this module you'll build your first HTTP server with node.js. You'll also learn why just having node is not enough.

  • Hello World
  • Understanding HTTP/1.1
  • Middleware

Connect Middleware

There are a lot of little things that need to happen with every incoming request: check some cookie, do some logging, authenticate, set up a session, ... With connect you can build a pipe of middleware components that each have their own responsibility without interfering with the rest of your code.

  • The need for middleware
  • Creating middleware components
  • Connect’s middleware components

Creating web applications in node.js using Express

Express goes further than Connect, and next to providing middleware, it sets up an MVC-based mechanism. This includes routing and working with view engines. In this module, you'll use Express primarily in a server-centric approach to create views.

  • Setting up a project with Express
  • Routing
  • Using a View Engine

Creating Services with Node.js

When adopting a more client-centric approach, Express also has us covered. You can use Express to set up a REST service that you can consume from your client.

  • Rest services
  • Building a Service with Express

Real-time communication with socket.io

REST is great for pull-scenarios, where your client knows when to fetch data. But what if your server wants to tell the client something? Then we can use WebSockets. This module covers socket.io which is both a server and client-side API to do real-time communication.

  • Web Sockets
  • Socket.io Introduction
  • Namespaces
  • Broadcasting

With Node.js the power and flexibility of JavaScript comes to the server side. JavaScript turns out to be the best language for scablable, IO-focused server tasks. This allows us to go beyond what's possible with classical thread-based IO we know from other server-side technologies. By using JavaScript both server and client-side, we only have to know one language and libraries are easy to re-use.

Participants of this course need to have a solid understanding of JavaScript and Web Development.

© 2018 U2U All rights reserved.