Thread overview
how can I load html files and not .dt or diet files in vibe.d
Feb 01, 2024
dunkelheit
Feb 01, 2024
Aravinda VK
Feb 10, 2024
dunkelheit
Feb 01, 2024
Rene Zwanenburg
Feb 10, 2024
dunkelheit
Feb 02, 2024
Menjanahary R. R.
Feb 10, 2024
dunkelheit
February 01, 2024

this is my code, I'm a begginer on vibe, and I want to use html and not diet files

`import vibe.vibe;

void main()
{
auto settings = new HTTPServerSettings;
settings.port = 8080;
settings.bindAddresses = ["::1", "127.0.0.1"];
auto listener = listenHTTP(settings, &hello);
scope (exit)
{
listener.stopListening();
}

logInfo("Please open http://127.0.0.1:8080/ in your browser.");
runApplication();

}

void hello(HTTPServerRequest req, HTTPServerResponse res)
{
res.render!"hola.dt";
}`

I tried to load my html through iframe but it not works

!!! 5
html
body
h1 hello diet
-iframe("hola.html")

please help me :')

February 01, 2024

On Thursday, 1 February 2024 at 03:20:31 UTC, dunkelheit wrote:

>

!!! 5
html
body
h1 hello diet
-iframe("hola.html")

please help me :')

Try

html
    body
        h1 hello diet
        iframe(src="hola.html")
February 01, 2024

On Thursday, 1 February 2024 at 03:20:31 UTC, dunkelheit wrote:

>

this is my code, I'm a begginer on vibe, and I want to use html and not diet files

Take a look at the static file example, I think that's close to what you're looking for.

https://github.com/vibe-d/vibe.d/blob/master/examples/http_static_server/source/app.d

February 02, 2024

On Thursday, 1 February 2024 at 03:20:31 UTC, dunkelheit wrote:

>

this is my code, I'm a begginer on vibe, and I want to use html and not diet files

`import vibe.vibe;

void main()
{
auto settings = new HTTPServerSettings;
settings.port = 8080;
settings.bindAddresses = ["::1", "127.0.0.1"];
auto listener = listenHTTP(settings, &hello);
scope (exit)
{
listener.stopListening();
}

logInfo("Please open http://127.0.0.1:8080/ in your browser.");
runApplication();
}

void hello(HTTPServerRequest req, HTTPServerResponse res)
{
res.render!"hola.dt";
}`

I tried to load my html through iframe but it not works

!!! 5
html
body
h1 hello diet
-iframe("hola.html")

please help me :')

Explore this link https://github.com/D-Programming-GDC/gdcproject for potential sources of inspiration.

February 10, 2024

On Thursday, 1 February 2024 at 10:44:24 UTC, Aravinda VK wrote:

>

On Thursday, 1 February 2024 at 03:20:31 UTC, dunkelheit wrote:

>

!!! 5
html
body
h1 hello diet
-iframe("hola.html")

please help me :')

Try

html
    body
        h1 hello diet
        iframe(src="hola.html")

gracias pero el resultado que obtuve fue que el mismo index.dt se me repetia en cascada y no me incluia en el iframe

February 10, 2024

On Thursday, 1 February 2024 at 13:29:40 UTC, Rene Zwanenburg wrote:

>

On Thursday, 1 February 2024 at 03:20:31 UTC, dunkelheit wrote:

>

this is my code, I'm a begginer on vibe, and I want to use html and not diet files

Take a look at the static file example, I think that's close to what you're looking for.

https://github.com/vibe-d/vibe.d/blob/master/examples/http_static_server/source/app.d

gracias por la solucion aunque esperaba que fuera un poco mas simple el proceso pero estare estudiando el codigo y su funcionamiento

February 10, 2024

On Friday, 2 February 2024 at 06:01:22 UTC, Menjanahary R. R. wrote:

>

On Thursday, 1 February 2024 at 03:20:31 UTC, dunkelheit wrote:

>

[...]

Explore this link https://github.com/D-Programming-GDC/gdcproject for potential sources of inspiration.

gracias por tu ayuda pero obtuve errores que nose solucionar :'(