Age | Commit message (Collapse) | Author | Files | Lines | |
---|---|---|---|---|---|
2024-02-20 | Add additional replace rules for node:* modules | Gabor Javorszky | 1 | -0/+2 | |
In that particular issue the compiled nuxt files end up importing the http module as node:http rather than http only. This bypasses unit's custom loader implementation which only check for the http or unit-http modules, and their websocket counterparts. This changeset adds replace sources for both the node:http and node:websocket import signatures. Closes: https://github.com/nginx/unit/issues/1013 Reviewed-by: Andrew Clayton <a.clayton@nginx.com> | |||||
2021-05-24 | Node.js: renamed "require_shim" to "loader". | Oisin Canty | 1 | -2/+2 | |
2021-05-12 | Node.js: a shim for overriding "http" and "websocket" modules. | Oisin Canty | 1 | -0/+27 | |
Also added stubs for Server.address() This was done to prevent crashes in some popular frameworks like express Supports both CommonJS and the new ES Modules system syntax e.g: app.js: const http = require('http') app.mjs: import http from "http" Usage on Node 14.16.x and higher: { "type": "external", "processes": {"spare": 0}, "working_directory": '/project', "executable": "/usr/bin/env", "arguments": [ "node", "--loader", "unit-http/require_shim.mjs" "--require", "unit-http/require_shim", "app.js" ] } Usage on Node 14.15.x and lower: { "type": "external", "processes": {"spare": 0}, "working_directory": '/project', "executable": "/usr/bin/env", "arguments": [ "node", "--require", "unit-http/require_shim", "app.js" ] } |