I
I
Ingerniated2016-10-09 20:26:47
Node.js
Ingerniated, 2016-10-09 20:26:47

What are servers made of?

Good evening, sorry if the question is stupid, I'm just new to programming
What is the server built from?
What methods (functions) should each server have and in what order are they done?
With that, where should I go next?

var http = require("http");
var fs = require("fs");

http.createServer(function(request, response) {
  fs.readFile("index.html", {encoding: "utf-8"}, function(error, file) {
      response.writeHead(200, {"Content-type" : "text/html"});
      response.write(file);
      response.end();
  });
}).listen(8000);
console.log('Server running on port 8000');

What is the best way to learn server programming?
It's just hard for me.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan, 2016-10-09
@Ingernirated

IMHO, to work with JS, you need to raise the level of knowledge of JS. I always thought that JS was a simple language (simpler than the PHP that I mostly work with), but in fact it seems that way while watching screencasts or doing crafts from guides. In fact, crutches begin when you start trying to write a real application.
Tip:
1.1) Kantor
1.2) Sorax - JavaScript Basics . It's purely JS, not tied to a platform.
2) CodeDojo - Basics of ES6 - so to speak, advanced training right off the bat.
3) Write a real project, let it be a copy of something existing. For example a blog or a feedback system.

A
Amazing-Space-Invader, 2016-10-09
@Amazing-Space-Invader

I advise you to start with some guides for beginners. Preferably in English (newer, more choice, huge community). In Russian, you can make this guide or a screencast by Ilya Kantor .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question