A URL shortener sounds like a weekend project, so I had an AI agent write one in plain Node with zero packages, then tested it with real requests. Here is what works, what the tests caught, and what I would fix before putting it online.
The build
The whole server is 17 lines. One route takes a URL and returns a random 6-character code. Another route looks the code up and redirects. Codes use letters and numbers with the lookalike characters removed, and the server retries if a generated code already exists.
The real requests
I sent a normal link and got back a short code. Opening that code returned a 302 redirect to the original page, and the stats route then reported one hit . So far, so good.
The part I care about most is validation. I sent a link that starts with javascript: and the server rejected it with a 400 . Only HTTP and HTTPS links are allowed.…