: Execute your code once before any request handlers do.
void _startup ( ) ...
To specify your code to execute once before any request
s are handled, create a source file "_startup.vely" and implement a function "void _startup()", which will be automatically picked up and compiled with your application.
Startup handler will execute just before the first request. It will not execute when the application starts, but when it receives the very first request.
Important: if you need cross-request global variables that would be available for the life of the process, i.e. to any request served by this process, do not use result(s) of any Vely statements, because such memory is released at the end of each request, and thus would become invalid after very first request served by this process. If you must, you can use either global variables or use C's "malloc()" functions. Note however, that this is rarely needed and generally should be avoided.
Here is a simple implementation of startup handler that just outputs "Hi there!!":
( after_request_handler before_request_handler building_URL getting_URL global_request_data non_request normalized_URL request request_URL startup_handler vely_dispatch_request
) SEE ALL
Copyright (c) 2017-2023 DaSoftver LLC. Vely is a trademark of Dasoftver LLC. The software and information herein are provided "AS IS" and without any warranties or guarantees of any kind. Vely elephant logo (c) 2022 DaSoftver LLC. This web page is licensed under CC-BY-SA-4.0
. Contact email firstname.lastname@example.org