TIL: Node.js HTTP server does not work with custom methods

TIL: Node.js HTTP server does not work with custom methods
Photo by Dim Hou / Unsplash

So I was being silly here and trying to implement a server with funky methods and endpoints, and very soon I realised something was not quite right.

Fast-forward some head scratches and google searches, and then I learned: HTTP servers with Node.JS have a limited list of allowed methods!

As of today, the list of allowed methods is in this file.

So no, you cannot call an HTTP endpoint with BAKE /me/cookies.
The server response is a straight 400 Bad Request if you try.

Subscribe to darlanalv.es

Sign up now to get access to the library of members-only issues.
Jamie Larson
Subscribe