Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | src/hero.mjs: Retire code | EuAndreh | 2024-03-21 | 1 | -695/+0 |
| | |||||
* | src/hero.mjs: Add statusMessage() and statusResponse() | EuAndreh | 2024-03-18 | 1 | -16/+14 |
| | |||||
* | src/hero.mjs: Log to stdout instead of stderr | EuAndreh | 2024-03-17 | 1 | -1/+1 |
| | | | | | | | | | | | | | | | | | The first question that this brings is: Is the output of the program useful for a downstream process? Is this logging an *output* of the program? But in this case, the answer is: yes, for both questions. A downstream program could very well be fed the output of the program via a pipe and process it, as the data being emitted is meant to be ingested. So instead of following the default "warnings ought to go to stderr" model, we acknowledge that the data is actually an *out*put, and send it to std*out*. | ||||
* | tests/js/hero.mjs: Add simple test for now() | EuAndreh | 2024-03-17 | 1 | -1/+2 |
| | |||||
* | src/hero.mjs: Use name of CWD as the default name of buildServer() | EuAndreh | 2024-03-17 | 1 | -2/+4 |
| | |||||
* | src/hero.mjs: Add "stopping-server" log | EuAndreh | 2024-03-17 | 1 | -0/+11 |
| | |||||
* | src/web.mjs: Move the "starting-server" logging into hero when .listen() | EuAndreh | 2024-03-17 | 1 | -0/+11 |
| | |||||
* | src/hero.mjs: Include "timestamp" in the logged data objects | EuAndreh | 2024-03-17 | 1 | -6/+11 |
| | |||||
* | src/hero.mjs: Explicitly inject "headers" key in req | EuAndreh | 2024-03-16 | 1 | -0/+2 |
| | |||||
* | src/hero.mjs: Add makeUpgradeListener() (again, now rewritten) | EuAndreh | 2024-03-16 | 1 | -0/+13 |
| | |||||
* | src/hero.mjs: use empty object as default value for renderHeaders() | EuAndreh | 2024-03-16 | 1 | -1/+1 |
| | |||||
* | src/hero.mjs: validateUpgrade(): Add note on 405 case | EuAndreh | 2024-03-16 | 1 | -0/+3 |
| | |||||
* | src/hero.mjs: Move interceptors.contentType() closer to the end of the list | EuAndreh | 2024-03-16 | 1 | -1/+1 |
| | |||||
* | src/hero.mjs: Add writeHead() and its helper functions | EuAndreh | 2024-03-16 | 1 | -0/+17 |
| | |||||
* | src/hero.mjs: Remove current makeUpgradeListener() and its helpers | EuAndreh | 2024-03-16 | 1 | -61/+0 |
| | |||||
* | src/hero.mjs: findHandler(): learn how to find upgrade routes | EuAndreh | 2024-03-16 | 1 | -8/+10 |
| | |||||
* | src/hero.mjs: Add interceptors.websocketHandshake() | EuAndreh | 2024-03-16 | 1 | -0/+24 |
| | |||||
* | src/hero.mjs: Remove WEBSOCKET_* constants | EuAndreh | 2024-03-16 | 1 | -9/+3 |
| | |||||
* | src/hero.mjs: Add validateUpgrade(), computeHash() and their helper functions | EuAndreh | 2024-03-16 | 1 | -0/+99 |
| | |||||
* | src/hero.mjs: Add "upgrade" and "socket" keys to `req` | EuAndreh | 2024-03-16 | 1 | -4/+11 |
| | | | | Also log on "in-request" the value of "upgrade". | ||||
* | src/hero.mjs: interceptors.contentType(): Generate body from status when missing | EuAndreh | 2024-03-16 | 1 | -5/+13 |
| | |||||
* | src/hero.mjs: Include stacktrace in 500 log entry | EuAndreh | 2024-03-15 | 1 | -0/+1 |
| | |||||
* | src/hero.mjs: Add makeUpgradeListener() | EuAndreh | 2024-03-15 | 1 | -0/+20 |
| | |||||
* | src/hero.mjs: Add handlerForConnection() | EuAndreh | 2024-03-15 | 1 | -0/+16 |
| | |||||
* | src/hero.mjs: Add support for "WEBSOCKET" type of route | EuAndreh | 2024-03-15 | 1 | -2/+7 |
| | |||||
* | src/hero.mjs: Add buildHttpPayload() | EuAndreh | 2024-03-15 | 1 | -0/+19 |
| | |||||
* | src/hero.mjs: Add emitHeaders() | EuAndreh | 2024-03-15 | 1 | -0/+6 |
| | |||||
* | src/hero.mjs: Add comboForLabel() | EuAndreh | 2024-03-15 | 1 | -0/+5 |
| | |||||
* | src/hero.mjs: Add isValidLabel() | EuAndreh | 2024-03-15 | 1 | -0/+9 |
| | |||||
* | src/hero.mjs: Destructure handler arguments in handleRequest() | EuAndreh | 2024-03-15 | 1 | -4/+4 |
| | |||||
* | src/hero.mjs: Include "headers" and "ref" in request param | EuAndreh | 2024-03-14 | 1 | -4/+7 |
| | |||||
* | src/hero.mjs: Add timing data to "in-response" log entry | EuAndreh | 2024-03-08 | 1 | -0/+9 |
| | |||||
* | src/web.mjs: Move logging and interceptors to the beginning of the file | EuAndreh | 2024-03-08 | 1 | -104/+104 |
| | |||||
* | src/hero.mjs: Make sure globalInceptors are used even when we get a 404 | EuAndreh | 2024-03-08 | 1 | -7/+14 |
| | |||||
* | src/hero.mjs: Add buildTable() | EuAndreh | 2024-03-08 | 1 | -1/+8 |
| | |||||
* | src/hero.mjs: server.listen() -> server.start(); server.close() -> server.stop() | EuAndreh | 2024-03-07 | 1 | -2/+2 |
| | |||||
* | src/hero.mjs: Add makeReopeningPipeReader() | EuAndreh | 2024-03-07 | 1 | -4/+41 |
| | | | | | This addresses point nº 2 from commit 40118a188fb05219d1188ff775ce71f66c8cb56a. | ||||
* | src/hero.mjs: makePipeReader() now returns a function for closing it | EuAndreh | 2024-03-07 | 1 | -17/+23 |
| | |||||
* | src/hero.mjs: Better handling of default values for arguments | EuAndreh | 2024-03-06 | 1 | -20/+10 |
| | | | | | Now one can give a partial specification of the object and still get the other attributes to have their default values. | ||||
* | src/hero.mjs: Add minimalistic "ping" action for doing smoke tests in production | EuAndreh | 2024-03-06 | 1 | -0/+1 |
| | |||||
* | src/hero.mjs: Add simplified implementation of `makePipeReader()` | EuAndreh | 2024-03-06 | 1 | -2/+5 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. | ||||
* | src/hero.mjs: Change server.listen() to receive no arguments | EuAndreh | 2024-03-06 | 1 | -4/+11 |
| | |||||
* | src/hero.mjs: Add skeleton for makePipeReaderFn() | EuAndreh | 2024-03-06 | 1 | -5/+20 |
| | |||||
* | src/hero.mjs: Add makeLineEmitter() | EuAndreh | 2024-03-06 | 1 | -0/+19 |
| | |||||
* | src/hero.mjs: Add rmIf() and mkfifo() | EuAndreh | 2024-03-06 | 1 | -6/+18 |
| | |||||
* | src/utils.mjs: s/first/findFirst/g | EuAndreh | 2024-03-06 | 1 | -1/+1 |
| | |||||
* | src/hero.mjs: Always recreate the unix socket file | EuAndreh | 2024-03-01 | 1 | -0/+3 |
| | |||||
* | src/hero.mjs: Add app name as first argument to buildServer() | EuAndreh | 2024-03-01 | 1 | -5/+8 |
| | |||||
* | src/hero.mjs: Add actionsFn() and lineHandlerFn() | EuAndreh | 2024-03-01 | 1 | -0/+76 |
| | |||||
* | src/utils.mjs: Define strSortFn() and use it on all files | EuAndreh | 2024-02-28 | 1 | -2/+2 |
| |