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 …


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

The result:
Alt Text


This content originally appeared on DEV Community and was authored by Jahongir Sobirov


Print Share Comment Cite Upload Translate Updates
APA

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/

MLA
" » Sphere.js creating http servers for beginners." Jahongir Sobirov | Sciencx - Friday May 7, 2021, https://www.scien.cx/2021/05/07/sphere-js-creating-http-servers-for-beginners/
HARVARD
Jahongir Sobirov | Sciencx Friday May 7, 2021 » Sphere.js creating http servers for beginners., viewed ,<https://www.scien.cx/2021/05/07/sphere-js-creating-http-servers-for-beginners/>
VANCOUVER
Jahongir Sobirov | Sciencx - » Sphere.js creating http servers for beginners. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/05/07/sphere-js-creating-http-servers-for-beginners/
CHICAGO
" » Sphere.js creating http servers for beginners." Jahongir Sobirov | Sciencx - Accessed . https://www.scien.cx/2021/05/07/sphere-js-creating-http-servers-for-beginners/
IEEE
" » Sphere.js creating http servers for beginners." Jahongir Sobirov | Sciencx [Online]. Available: https://www.scien.cx/2021/05/07/sphere-js-creating-http-servers-for-beginners/. [Accessed: ]
rf:citation
» Sphere.js creating http servers for beginners | Jahongir Sobirov | Sciencx | 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.

You must be logged in to translate posts. Please log in or register.