Programming

Express.js Lessons. Express: Basics and Middleware. Part 2.

Hey, guys! Let's continue our lesson about Express basics and Middleware. The result is (add to app.js):

Category: Programming
0

1. Express.js Lessons. Basics and Middleware. Part 1.

Hey all! This and next articles will be devoted to various themes on development within the context of one app that we will consequently improve. This app is a web chat.

Category: Programming
0

24. Node.js Lessons.Reading Parameters From the Command Line and Environment.

Hey all! The first topic of this article is transferring of parameters and the script for Node.js. To show you the principle, we will create a file with a simple code, so add it (server.js):

Category: Programming
0

23. Node.js Lessons. Domains, asynchronous try.. catch. Part 3.

How and what does app.js consist of? It is made in a way that from the very beginning we create a domain and then launch our app within this domain. Here all modules can be connected, a server gets created, etc. But why do we connect modules here? The reason is that some other modules can be added when the connection happens, and they can connect others, too.

Category: Programming
0

23. Node.js Lessons. Domains, asynchronous try.. catch. Part 2.

So, we continue our lesson. Let us make this example a little bit more complicated by adding work with the files in the following way:

Category: Programming
0

23. Node.js Lessons. Domains, asynchronous try.. catch. Part 1.

Hey all! Our topic for today is Domains. Domains are one of the Node.js options lacking both in standard JavaScript and browser versions of JavaScript. Domains were created to catch any asynchronous errors. For instance, if we look at the server that we’ve explored in one of our previous articles (download the lesson code from here for your convenience), we will see that everything is ok when it’s working

Category: Programming
0

22. Long Polling Chat, POST Reading. Pt 2.

So, whatever we type, we see the same message to be sent. Let us fix it. We send messages with a POST method. In order to read this method from req, we need to work with it as with a stream. So, let us look at the following scheme that describes a request’s lifecycle, in particular of the req and res objects.

Category: Programming
0

22. Long Polling Chat, POST Reading. Pt 1.

Hey all! The aim of our lesson for today is to learn how to create a Node.js chat. Our first chat will be rather simple.

Category: Programming
0

21. Node.js Lessons. Writable Response Stream (res), Pipe Method. Pt.2

Upon the file ending you will see the end event, in the handler of which we will end our response by calling res.end. Thus, the outgoing connection will be closed for the file has been completely sent. The resulting code is quite versatile:

Category: Programming
0

21. Node.js Lessons. Writable Response Stream (res), Pipe Method. Pt.1

Our next step will be using the streams to work with network connections. And we will start from delivering files to a visitor. As you may remember, we’ve already had a task like this: if a visitor requires the following url, you will give him the file. Let us create a file pipe.js with the following code (for your convenience, you can download code' lesson from the repository because we'll need an HTML file from there):

Category: Programming
0

Sign in

Forgot password?

Or use a social network account

 

By Signing In \ Signing Up, you agree to our privacy policy

Password recovery

You can also try to

Or use a social network account

 

By Signing In \ Signing Up, you agree to our privacy policy