Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mini Web Server

A mini web server built by following Build Your Own Web Server From Scratch In Node.JS.

Getting started

To start up all the servers:

$ npm run start

Testing TCP Server

To test the TCP server using callback to echo back the data:

$ nc localhost 8081

To test the TCP server using async/await to echo back the data:

$ nc localhost 8082

To test the TCP server echoing back the data by message:

$ nc localhost 8083

Testing HTTP Server

To test the default response:

$ curl -vvv http://localhost:8080

To test the echo response:

$ curl -vvv --data-binary 'hello' http://localhost:8080/echo

To test the echo response using chunked request:

$ curl -vvv -T- http://localhost:8080/echo

To test the sheep counting using chunked response:

$ curl -vvv http://localhost:8080/sheep

To test static file serving:

$ curl -vvv http://localhost:8080/files/README.md

To test static file serving using HEAD method:

$ curl -vvv -I http://localhost:8080/files/README.md

To test 404 response when the file is not found:

$ curl -vvv http://localhost:8080/files/UNKNOWN.md

To test compressed response:

$ curl -vvv --compressed http://localhost:8080

About

A mini web server built from scratch

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages