Mr.Possumz
Is there a way to use Javascript as easily as Php?
Try taking a look at https://fresh.deno.dev/, a web framework built specifically by the Deno team to run on Deno. It does run on deploy but can run in many other environments and I think it's server-side rendering is similar enough to PHP's that it should be easier for you to draw parallels
40 replies
Is there a way to use Javascript as easily as Php?
I think part of the issue here is that PHP has a more limited scope and obscures a lot of what's going on behind the scenes. It's designed with one purpose in mind and that is serving pages, with tooling aimed at making it very easy to do exactly that.
Deno, on the other hand, aims to be a viable option for a wider array of use cases. The result of that is the tooling and environment is more open ended. It can be (and very often is) used as a web server similar to PHP but it requires a little more effort to get off the ground. You'll need to research some of the JS frameworks and packages commonly used to accomplish this if you want to make the move.
40 replies
not sure why this code is erroring
If
Promise.all()
is expecting an iterable of promises, technically what you're returning is a composition of a promise and a chained statement. I don't often use Promise.all but I'm betting that fetchPage is generating the promise and passing the promise to the chained .then()
statement, which fails to destructure the name and videos variables.
You probably just need to declare the map callback as async to generate a promise.13 replies