how can I load html files and not .dt or diet files in vibe.d

Menjanahary R. R. megnany at afaky.com
Fri Feb 2 06:01:22 UTC 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.




More information about the Digitalmars-d-learn mailing list