Answer the question
In order to leave comments, you need to log in
How to write a server on node?
Comrades, tell me, I got into a situation that I’m reading an article, they seem to understand it clearly, but I don’t understand the essence of what the server should consist of, what it should include, what logic it should use in order to be able to work.
What book or article is worth reading in order to understand what I need and what functions to use, what to try to achieve from the server so that it does.
According to this example, I was able to start the server with only one file, which cannot have css or js files if they are connected to it.
www.nodebeginner.ru
Answer the question
In order to leave comments, you need to log in
I'll tell you from scratch
var express = require('express');
var app = express();
var http = require('http');
var server = http.createServer();
var io = require('socket.io').listen(server, options);
server.listen('3636');
io.on("connection", function (socket) {
//Сюда параметры подключения
})
unable to include css and js files
Because they connect in the browser, not on the server.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question