DEV Community

Jahongir Sobirov
Jahongir Sobirov

Posted on


Sphere.js creating http servers for beginners

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 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
Enter fullscreen mode Exit fullscreen mode

Run this:

node test.js
Enter fullscreen mode Exit fullscreen mode

The result:
Alt Text

Top comments (0)

Timeless DEV post...

Git Concepts I Wish I Knew Years Ago

The most used technology by developers is not Javascript.

It's not Python or HTML.

It hardly even gets mentioned in interviews or listed as a pre-requisite for jobs.

I'm talking about Git and version control of course.

One does not simply learn git