summaryrefslogtreecommitdiff
path: root/src (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-03-16src/hero.mjs: Add "upgrade" and "socket" keys to `req`EuAndreh1-4/+11
Also log on "in-request" the value of "upgrade".
2024-03-16src/hero.mjs: interceptors.contentType(): Generate body from status when missingEuAndreh2-13/+44
2024-03-15src/hero.mjs: Include stacktrace in 500 log entryEuAndreh2-2/+5
2024-03-15src/hero.mjs: Add makeUpgradeListener()EuAndreh2-0/+80
2024-03-15src/hero.mjs: Add handlerForConnection()EuAndreh2-0/+56
2024-03-15src/hero.mjs: Add support for "WEBSOCKET" type of routeEuAndreh2-2/+12
2024-03-15src/hero.mjs: Add buildHttpPayload()EuAndreh2-0/+67
2024-03-15src/hero.mjs: Add emitHeaders()EuAndreh2-0/+30
2024-03-15src/hero.mjs: Add comboForLabel()EuAndreh2-0/+25
2024-03-15src/hero.mjs: Add isValidLabel()EuAndreh2-0/+28
2024-03-15src/hero.mjs: Destructure handler arguments in handleRequest()EuAndreh1-4/+4
2024-03-14tests/lighttpd.conf: add the upgrade header without replacing existing onesEuAndreh1-1/+1
2024-03-14Makefile: Use TCP port 6001EuAndreh1-1/+1
2024-03-14tests/lighttpd.conf: Forward "enable" header to allow connection upgradeEuAndreh1-0/+3
2024-03-14src/hero.mjs: Include "headers" and "ref" in request paramEuAndreh2-11/+55
2024-03-14Makefile: Add "run-binder" to expose lighttpd's unix socket to a TCP portEuAndreh1-1/+7
2024-03-14src/web.mjs: Add trailing newline to bodyEuAndreh1-2/+2
2024-03-08src/hero.mjs: Add timing data to "in-response" log entryEuAndreh2-2/+14
2024-03-08src/utils.mjs: Add dissoc()EuAndreh2-0/+24
2024-03-08src/web.mjs: Move logging and interceptors to the beginning of the fileEuAndreh2-595/+595
2024-03-08src/hero.mjs: Make sure globalInceptors are used even when we get a 404EuAndreh2-8/+30
2024-03-08src/hero.mjs: Add buildTable()EuAndreh2-1/+21
2024-03-07src/hero.mjs: server.listen() -> server.start(); server.close() -> server.stop()EuAndreh3-7/+7
2024-03-07src/hero.mjs: Add makeReopeningPipeReader()EuAndreh2-29/+130
This addresses point nº 2 from commit 40118a188fb05219d1188ff775ce71f66c8cb56a.
2024-03-07src/hero.mjs: makePipeReader() now returns a function for closing itEuAndreh2-21/+23
2024-03-07tests/js/hero.mjs: Better names for pipes and sockets created by testsEuAndreh2-22/+29
2024-03-07rm -rf tools/EuAndreh3-319/+0
2024-03-06src/hero.mjs: Better handling of default values for argumentsEuAndreh1-20/+10
Now one can give a partial specification of the object and still get the other attributes to have their default values.
2024-03-06src/hero.mjs: Add minimalistic "ping" action for doing smoke tests in productionEuAndreh2-0/+20
2024-03-06src/hero.mjs: Add simplified implementation of `makePipeReader()`EuAndreh2-2/+26
There are a few limitations of the current approach that I didn't figure out how to solve yet: 1. when stopping the server, mainly for shutting down the Node.js process when running the tests, we need to open and close the pipe in write mode at least once, otherwise it hangs forever. After opening and closing it, the "autoClose" functionality of the `fs.createReadStream()` kicks in, and it closes, otherwise the test hangs forever as Node.js still has open handles. That's why the `server.close()` function has a gratuitous call to `fs.createWriteStream(pipe).end()`: so that when stopping the server, the pipe is always closed at least once; 2. when actually running the application, if one tries an IPC command like: $ echo '{ "action": "config-dump" }' > web.pipe It works, but only for the first time. As this shell line opened the pipe, wrote to it and then closed it, the reader that `makePipeReader()` constructed closed, but didn't open it again. So when running the exact same IPC command for a second time, the shell hangs, as there is no process on the other side listening for the command and consuming the pipe. Shortcoming nº 2 is much more important to be solved, as we can live with shortcoming nª 1 for some time. Both are to be fixed in the near future.
2024-03-06src/hero.mjs: Change server.listen() to receive no argumentsEuAndreh3-13/+35
2024-03-06src/hero.mjs: Add skeleton for makePipeReaderFn()EuAndreh2-5/+40
2024-03-06src/hero.mjs: Add makeLineEmitter()EuAndreh2-0/+100
2024-03-06src/utils.mjs: Add first(), rest(), butlast() and last()EuAndreh2-0/+83
2024-03-06src/hero.mjs: Add rmIf() and mkfifo()EuAndreh6-28/+111
2024-03-06tests/runner.mjs: Add missing await in t.test("", () => {})EuAndreh6-152/+153
2024-03-06src/utils.mjs: s/first/findFirst/gEuAndreh3-10/+10
2024-03-01src/hero.mjs: Always recreate the unix socket fileEuAndreh1-0/+3
2024-03-01src/hero.mjs: Add app name as first argument to buildServer()EuAndreh2-8/+11
2024-03-01src/hero.mjs: Add actionsFn() and lineHandlerFn()EuAndreh2-1/+189
2024-03-01Makefile: Let the application recreate its pipes and socketsEuAndreh1-1/+1
2024-03-01Setup user-level lighttpd reverse proxy for development and testingEuAndreh6-1/+126
Add static files as in production, too.
2024-03-01src/web.mjs: Try out new hero APIEuAndreh1-13/+13
2024-03-01src/ircd.mjs: Remove unix socket before recreating itEuAndreh2-5/+10
2024-03-01src/api.mjs: Simplify handling of argumentsEuAndreh2-17/+12
2024-03-01src/utils.mjs: Remove eq(), use utils.isDeepStrictEqual from "node:utils" ↵EuAndreh2-114/+0
instead
2024-02-28src/utils.mjs: Replace promisify() by util.promisify()EuAndreh3-42/+6
2024-02-28src/utils.mjs: Add undefinedAsNull()EuAndreh2-0/+22
2024-02-28src/utils.mjs: Define strSortFn() and use it on all filesEuAndreh5-5/+25
2024-02-28tests/runner.mjs: Use process.stderr.write() to avoid printing newlines when ↵EuAndreh1-2/+5
not needed