DevOps January 27, 2026

Why I Abandoned Vercel's 'serve' for 'http-server'

By Kahraman Bayraktar
Editorial NoteThis article was drafted with AI assistance from real engineering problems, debugging sessions, and architectural questions that surfaced during my own software development work. While the underlying experience is real, AI-generated explanations may contain inaccuracies.

Today I want to share a pragmatic lesson on Tool Selection from the early static HTML/JS iteration of this portfolio (prior to migrating to Next.js).

When previewing those early plain HTML/JS pages locally, I initially reached for Vercel's serve package. While serve is great for previewing pre-built Single-Page Application (dist/) bundles, its opinionated URL rewriting clashed with our production Nginx static file layout.

The "Clean URL" Mismatch

By default, serve enables Clean URLs: if you navigate to /blog.html, it issues a 301 redirect stripping the extension to /blog, and internally resolves /blog back to blog.html.

That behavior is convenient when your production host uses identical rewrite rules, but it clashed with two realities of our early setup:

  1. Local (serve): Automatically stripped .html extensions via 301 redirects, dropping or altering query strings like ?id=... when combined with folder collisions.
  2. Production (Nginx): Served explicit .html files without automatic extensionless rewrites unless custom try_files directives were added.
  3. Configuration Friction: Writing custom serve.json rules just to disable the tool's opinionated defaults meant fighting the local server instead of mirroring plain static file behavior.

Choosing a Predictable Tool

Instead of layering configuration workarounds onto serve, I switched local static previews to http-server:

npx http-server . -p 8080 -c-1
  • -c-1: Sets Cache-Control: no-cache, preventing the browser from serving stale assets via 304 Not Modified cache hits during active editing.
  • Predictable File Mapping: No implicit extension-stripping redirects. Requesting /blog.html serves /blog.html verbatim, matching basic static file servers 1-to-1.

Leveling Up as an Engineer

Coming from enterprise .NET, we are used to comprehensive frameworks with rich conventions. In lightweight static tooling, however, unasked-for magic creates environment parity bugs.

Sometimes the more feature-rich tool introduces friction simply because its opinions don't match your deployment target. Recognizing when to step down to a simpler, transparent tool is a hallmark of practical engineering.