|
|
|
|
|
by throwitaway1123
684 days ago
|
|
> One of those environments is a GUI which is naturally a good application for async. The other is not. Backend web development is still largely input -> process -> output. Node is just shoehorning JS in, and pretending that JavaScript's weaknesses are strengths. Until you need to perform two or more IO operations at the same time (e.g. more than one of: database query, Redis query, HTTP request, file operation, etc). Then it becomes: input -> Promise.all (or Promise.race, or Promise.allSettled, or Promise.any) -> output. If you watch Ryan Dahl's original presentation introducing Node, you'll see that JS was explicitly chosen because of its asynchronous nature — it wasn't shoehorned in: https://youtu.be/EeYvFl7li9E?t=795&si=FG0yxaGoCgz1rqOX > Not sure what you mean. There are a bunch of ways to run PHP Node doesn't require an upstream CGI server at all. There's a server built-in to the Node binary: https://nodejs.org/docs/latest-v22.x/api/http.html#class-htt... |
|
Though you'll still want a process manager for this to make sure it stays up. Which it won't, over the long term.
PHP also has a built-in webserver, which you shouldn't use.
FrankenPHP is the better way to do this with PHP: you get a full Caddy build, with all that offers, with a built-in PHP engine.