Re: Display a random image with vibe.d

2021-06-21 Thread Christian Köstlin via Digitalmars-d-learn
On 2021-06-20 17:14, vnr wrote: On Sunday, 20 June 2021 at 14:28:26 UTC, jfondren wrote: On Sunday, 20 June 2021 at 13:58:22 UTC, vnr wrote: Thanks for the answers, I understand better what is going on. So, what should I do to make my server respond with a random image, and not the random

Re: Display a random image with vibe.d

2021-06-20 Thread vnr via Digitalmars-d-learn
On Sunday, 20 June 2021 at 14:28:26 UTC, jfondren wrote: On Sunday, 20 June 2021 at 13:58:22 UTC, vnr wrote: Thanks for the answers, I understand better what is going on. So, what should I do to make my server respond with a random image, and not the random image page? I'm fairly new to

Re: Display a random image with vibe.d

2021-06-20 Thread jfondren via Digitalmars-d-learn
On Sunday, 20 June 2021 at 13:58:22 UTC, vnr wrote: Thanks for the answers, I understand better what is going on. So, what should I do to make my server respond with a random image, and not the random image page? I'm fairly new to vibe.d, so I don't yet know the intricacies of how to handle

Re: Display a random image with vibe.d

2021-06-20 Thread vnr via Digitalmars-d-learn
On Sunday, 20 June 2021 at 13:06:20 UTC, jfondren wrote: On Sunday, 20 June 2021 at 12:34:33 UTC, vnr wrote: I don't understand why the image doesn't display, when I take an image from the internet and give the url, it works fine though. ``` $ curl -s http://127.0.0.1:8080/|grep img

Re: Display a random image with vibe.d

2021-06-20 Thread jfondren via Digitalmars-d-learn
On Sunday, 20 June 2021 at 12:34:33 UTC, vnr wrote: I don't understand why the image doesn't display, when I take an image from the internet and give the url, it works fine though. ``` $ curl -s http://127.0.0.1:8080/|grep img ``` This is a relative URL, so to satisfy it the

Re: Display a random image with vibe.d

2021-06-20 Thread pilger via Digitalmars-d-learn
On Sunday, 20 June 2021 at 12:34:33 UTC, vnr wrote: I don't understand why the image doesn't display, when I take an image from the internet and give the url, it works fine though. maybe this works: const auto rndimg = format("/images/rndimg/img%d.jpg", a); Also, is this a good way to

Display a random image with vibe.d

2021-06-20 Thread vnr via Digitalmars-d-learn
Hello, I would like to display a random image each time a page is refreshed. I think my random function works, but the image does not appear on the page. I have this template: ``` /public /images /rndimg img1.jpg img2.jpg img3.jpg /source