class Noir::JSHttpRouteExtractor

Overview

Extracts routes from direct Node.js core http/https createServer handlers.

This covers the stdlib shape where applications branch on req.method and req.url/pathname inside a single request listener, rather than registering routes through a framework DSL.

Defined in:

miniparsers/js_http_route_extractor.cr

Constant Summary

HTTP_METHODS = Set {"GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS", "TRACE"}
SOURCE_EXTENSIONS = [".js", ".mjs", ".cjs", ".jsx", ".ts", ".mts", ".tsx"]

Class Method Summary

Class Method Detail

def self.extract(file_path : String, content : String, debug : Bool = false) : Array(Endpoint) #

[View source]
def self.source_file?(file_path : String) : Bool #

[View source]