Vely logo install | documentation | examples | articles | changelog
16.6.0 released on Mar 08, 2023 | articles updated on Mar 20, 2023

Before request handler

Purpose: Execute your code before a request is handled.

void _before ( ) ...
Every Vely request goes through a request dispatcher (i.e. vely_dispatch_request() function), which is auto-generated. In order to specify your code to execute before a request is handled, create a source file "_before.vely" and implement a function "void _before()", which will be automatically picked up and compiled with your application.

If no request executes (for example if your application does not handle a given request), before-request handler does not execute either.


Here is a simple implementation of before-request trigger that just outputs "Getting Started!!":
#include <vely.h>

void _before()
    out-header default
    @Getting Started!!

See also

Requests ( 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 (documentation)

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