123 hello world
This is a condensed version of Vely Hello World that you can run in minutes. No additional software needs to be installed. For more, see
examples.
Step 1: Install Vely
First
install Vely.
Step 2: Build it
Create Hello World source file (hello.vely); note it's all one bash command:
echo '#include "vely.h"
void hello()
{
out-header default
@Hello World!
}' > hello.vely
Create Hello World application:
sudo vf -i -u $(whoami) helloworld
Make Hello World application:
vv -q
Step 3: Run it
You can run Hello World both as a service and from command line:
- As a service, first start your Hello World FastCGI application server:
vf helloworld
then connect to it:
export REQUEST_METHOD=GET
export SCRIPT_NAME="/helloworld"
export PATH_INFO="/hello"
cgi-fcgi -connect /var/lib/vv/helloworld/sock/sock /
- From command line:
export REQUEST_METHOD=GET
export SCRIPT_NAME="/helloworld"
export PATH_INFO="/hello"
/var/lib/vv/bld/helloworld/helloworld
Expected result
The end result looks like this (notice in bold the responses from your web application and the command line):
You have run Hello World with Vely, first by talking directly to a
FastCGI server and then from command line. See
FastCGI_client for a similar example that uses TCP sockets.
See also
Quick start (
123_hello_world )
SEE ALL (
documentation)