Build Your Own Web Server From Scratch In Node.JS
$22.00
Minimum price
$28.00
Suggested price

Build Your Own Web Server From Scratch In Node.JS

Learn network programming, HTTP, and WebSocket by coding a Web Server

About the Book

Learn by doing: code a Web server in Node.js

Most people use HTTP daily, but few understand its inner workings. This "Build Your Own X" book dives deep, teaching basics from scratch for a clearer understanding of the tools and tech we rely on.

  • Network programming.
  • Protocols & communication.
  • HTTP in detail.
  • WebSocket & concurrency.

The project uses Node.js and TypeScript without any dependencies, but many concepts are language-agnostic, so it’s valuable for learners of any language.

Beyond coding exercises

At the end of each chapter, there are discussions about:

  • What’s missing from the code? The gap between toys and the real thing, such as optimizations and applications.
  • Important concepts beyond coding, such as event loops and backpressure. These are what you are likely to overlook.
  • Design choices. Why stuff has to work that way? You can learn from both the good ones and the bad ones.
  • Alternative routes. Where you can deviate from this book.

Build your own X

Why take on a build-your-own-X challenge? A few scenarios to consider:

  • Students: Solidify learning, build portfolio, stand out in future careers.
  • Developers: Master fundamentals beyond frameworks and tools.
  • Hobbyists: Explore interests with flexible, extensible projects.

This is part of the “Build Your Own X” book series, which includes books on building your own Redis, database, and compiler.

https://build-your-own.org

About the Author

build-your-own.org
build-your-own.org

Educational software development materials.

Visit my website for more content: https://build-your-own.org

Subscribe to my mailing list for my future books.

Books:

Build Your Own Redis

Build Your Own Database

From Source Code To Machine Code

Build Your Own Web Server

Packages

The Book
  • PDF

  • EPUB

  • English

$22.00
Minimum price
$28.00
Suggested price
Book + Source code

Includes TypeScript and JS code for each chaper.

Includes:

  • extras
    Source code per chapter

    TypeScript and JS code for each chapter.

  • PDF

  • EPUB

  • English

$35.00
Minimum price
$38.00
Suggested price

Table of Contents

Designed to guide you through your own web server implementation, the book follows a _step-by-step_ approach, and each chapter builds on the previous one.

An outline of each step:

1.  TCP echo server.
    - Socket primitives in Node.JS.
    - Event-based programming.
    - `async/await` and promises.
2.  A simple messaging protocol.
    - Implementing a network protocol in TCP.
    - Working with byte streams and managing buffers.
3.  Basic HTTP server.
    - HTTP semantics and syntax.
    - Generating dynamic content.
      - Async generators.
4.  Core applications.
    - Serving static files.
      - File IO in Node.JS.
      - Programming tip: avoiding resource leaks.
      - Range requests.
    - Caching control.
    - Compression.
      - The stream and pipe abstraction.
5.  WebSocket.
    - Message-based designs.
    - Concurrent programming.
      - Blocking queues.

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

80% Royalties. Earn $16 on a $20 book.

We pay 80% royalties. That's not a typo: you earn $16 on a $20 sale. If we sell 5000 non-refunded copies of your book or course for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earnedover $13 millionwriting, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub