Vely application runs by processing requests. A request always takes form of an HTTP request, meaning a URL and an optional HTTP request body. This is regardless of whether it's an application server or a command-line application. See request-URL for more details on the structure of a URL, and building-URL on using URL in your application.
vely-dispatch-request (a main Vely request dispatcher) uses request name to execute the appropriate function that handles the request.
This handling is based on the names of .vely files, i.e. source code files that make up your application. The request name always matches the file name that implements it.
So for example, file "get_stock.vely" handles request "get_stock" by implementing a function "void get_stock()" in it (the implementation is done by using request-handler). A request that is meant to call this function would have "/get_stock" in its URL path right after the application path (see request-URL). The routing of this request to the namesake function will be done automatically by Vely. For instance, if application name is "trading" and request name "get_stock", such request would be called by URL like (note that hyphens are converted to underscores, so "get-stock" is the same as "get_stock"):
Thus file "get_stock.vely" must implement a function "void get_stock()" (with request-handler), and in the code below, it simply outputs text "Hello from get_stock: some_value":
request-handler /get-stock
input-param some_param
@Hello from get-stock: <<p-out some_param>>end-request-handler
If the name of .vely file starts with an underscore ("_"), then it is a non-request file and it will not handle a request. See how-vely-works.
Tasks
A request can have any number of input parameters, and based on some of them, perform one or more tasks. See task-parameters. In general, selecting what exactly will be done within a request is determined by a request name and optional task-parameter values within the request. Often, a request performs a single task. See application-architecture.
You are free to copy, redistribute and adapt this web page (even commercially), as long as you give credit and provide a link back to this page (dofollow) - see full license at CC-BY-4.0. Copyright (c) 2019-2023 Dasoftver LLC. Vely and elephant logo are trademarks of Dasoftver LLC. The software and information on this web site are provided "AS IS" and without any warranties or guarantees of any kind.