Skip to content

Comment on Show HN: HTTP Status as a Service

Comments

    require("express")().get("/:status", (req, res) => res.status(req.params.status).end()).listen(80)

gotta add a NaN check in there or it'll hang

        require("express")().get("/:status", (req, res) => res.status(+req.params.status || 400).end()).listen(80)

You just broke my HTTP status 0.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.