summary refs log tree commit diff
path: root/scripts/util/getRouteDescriptions.js
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-10-07 15:08:48 +0200
committerRory& <root@rory.gay>2025-10-07 15:08:48 +0200
commit251eaf9519d68686acaf2c29fccc92294e0dfa80 (patch)
tree306240c5cfbdb4e9b8b70349cdc493c05c2f2e76 /scripts/util/getRouteDescriptions.js
parenttypescript: use build mode rather than project mode (diff)
downloadserver-ts-251eaf9519d68686acaf2c29fccc92294e0dfa80.tar.xz
build: always run openapi and schema generation, use build mode
Diffstat (limited to 'scripts/util/getRouteDescriptions.js')
-rw-r--r--scripts/util/getRouteDescriptions.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/scripts/util/getRouteDescriptions.js b/scripts/util/getRouteDescriptions.js

index a79dac96..54b5e1bc 100644 --- a/scripts/util/getRouteDescriptions.js +++ b/scripts/util/getRouteDescriptions.js
@@ -13,17 +13,24 @@ let currentPath = ""; If someone could fix that I'd really appreciate it, but for now just, don't do that :p */ -const proxy = (file, method, prefix, path, ...args) => { +/** + * @param {string} file + * @param {string} method + * @param {string} prefix + * @param {string} path + * @param args + */ +function proxy(file, method, prefix, path, ...args) { const opts = args.find((x) => x?.prototype?.OPTS_MARKER == true); if (!opts) return console.error( `${file} has route without route() description middleware`, ); - console.log(prefix + path + " - " + method); + console.log(`${method.toUpperCase().padStart("OPTIONS".length)} ${prefix + path}`); opts.file = file.replace("/dist/", "/src/").replace(".js", ".ts"); routes.set(prefix + path + "|" + method, opts()); -}; +} express.Router = () => { return Object.fromEntries(