www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - how can I load html files and not .dt or diet files in vibe.d

reply dunkelheit <arcanet192 gmail.com> writes:
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 :')
Jan 31
next sibling parent reply Aravinda VK <mail aravindavk.in> writes:
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") ```
Feb 01
parent dunkelheit <arcanet192 gmail.com> writes:
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
Feb 10
prev sibling next sibling parent reply Rene Zwanenburg <renezwanenburg gmail.com> writes:
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
Feb 01
parent dunkelheit <arcanet192 gmail.com> writes:
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
Feb 10
prev sibling parent reply Menjanahary R. R. <megnany afaky.com> writes:
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.
Feb 01
parent dunkelheit <arcanet192 gmail.com> writes:
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 :'(
Feb 10