This content originally appeared on DEV Community and was authored by Jahongir Sobirov
What is Sphere.js?
Sphere.js is designed to create these simple http servers. So what is an http server? An HTTP server is a small and simple server that can be created in node.js. In Node.js, you can do this mainly through http, express.js and socket.io. It takes a lot of time to learn these. However, sphere.js is not like that. This framework is mainly recommended for beginners.
Using sphere.js
Let’s download this framework first and we will do this using github cli: gh repo clone Jahongir2007/sphere.js
Creating simple http server in Sphere.js:
const sphere = require("./sphere"); // importing sphere.js
const app = sphere; // creating sphere application
app.options({ // creating http server
head: 200, // server head
send: "Hello, world!", // getting text for http server
listen: 8000 // listening http server
});
Run this:
node test.js
This content originally appeared on DEV Community and was authored by Jahongir Sobirov

Jahongir Sobirov | Sciencx (2021-05-07T06:28:10+00:00) Sphere.js creating http servers for beginners. Retrieved from https://www.scien.cx/2021/05/07/sphere-js-creating-http-servers-for-beginners/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.