Vibe.d navigation
Steven Schveighoffer
schveiguy at gmail.com
Tue Mar 31 19:34:55 UTC 2020
On 3/31/20 2:57 PM, GreatSam4sure wrote:
> I am playing with the vibe.d for some days now. One thing I am
> struggling with is move from one page to another using web interface.
> The naming of the functions and proper navigation from one page to
> another is not clear to me.
>
> How to move from one page to another. I will appreciate any help.
I'm not sure what you mean.
Vibe has ways to control the route names of the members of your web
interface using UDAs, but primarily uses the name of the functions.
A nice way to see what is registered is to turn the log level to trace
when you are setting up your routes, and then set it back to normal
during runtime. This prints out all the routes as vibe registers them.
e.g.:
void main()
{
setLogLevel(LogLevel.trace);
auto router = new URLRouter();
... // set up routes
auto listener = listenHTTP(settings, router);
setLogLevel(LogLevel.diagnostic);
... // run your event loop
}
If you have more specific examples, I'm glad to help you understand. If
you haven't already read it, you should read this page:
https://vibed.org/api/vibe.web.web/registerWebInterface
-Steve
More information about the Digitalmars-d-learn
mailing list