Vely logo Empower C
install     tutorials     examples     documentation     license     about

11.0.11 released on Jul 25, 2022



Vely application runs by processing requests. A request always takes form of URL query (GET or POST) that generally contains input parameters.

A predefined input-parameter "req" must always be present - it's the name of the request. vely_dispatch_request (a main Vely request dispatcher) uses "req" input parameter to route the request to the appropriate function that handles it. This handling is based on the names of .v files, i.e. source code files that make up your project.

Certain .v files in a Vely project handle requests - those are files with names that don't start with an underscore ('_'). The request handled by each file is given by its base file name. So for example file "get_stock.v" handles request "get_stock" by implementing a function "void get_stock()" in it. A request that is meant to call this function would have "req=get_stock" in it. The routing of this request to the namesake function will be done automatically by Vely. For instance, such request would be called by URL like:
http://<your website>/<app name>?req=get_stock&other_param=other_value...

Note that if your application has only one request-handling .v source file, then "req" parameter may be omitted and any incoming requests will be routed to the code implemented in that file.

If the name of .v file starts with an underscore ("_"), then it is a non_request file.

Each .v file that handles a request must implement a function with the same base name as that file, and this function is called to handle the request. So in the above example, file "get_stock.v" must implement a function "void get_stock()", and in the code below, it simply outputs text "Hello from get_stock":
void get_stock()
   @Hello from get_stock

Note that because "req" is a predefined symbol, you cannot use it as a name for any other object (such as variables, functions etc.).

Aside from "req" input parameter, a request can have any number of other input parameters, and based on them, perform any number of actions. A "request" generally refers to one or more actions that, based on some criteria, are grouped together under a single request.


Requests ( non_request   after_request_handler   before_request_handler   input-param   request   startup_handler   url-param   vely_dispatch_request  )  SEE ALL (documentation)

Copyright (c) 2022 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. This web page is licensed under CC-BY-SA-4.0.