V (Vlang) application runtime

Overview

V is a very simple modern language, similar to Go. It’s a statically typed compiled programming language designed for building maintainable software. Its design has also been influenced by Oberon, Rust, Swift, Kotlin, and Python. One of its forces is it comes with a strong standard library, built-in modules and a package manager. Thus, it includes a web server easy to use in V applications : Veb.

V (Vlang) is a new runtime. Help us to improve it by reporting any issue or suggestion on the Clever Cloud Community

Create your V (Vlang) application

To create a new V (Vlang) application, use the Clever Cloud Console or Clever Tools:

clever create --type v

Configure your V (Vlang) application

Mandatory needs

V (Vlang) runtime only requires a working application listening on 0.0.0.0:8080.

Build phase

During the build phase, the V (Vlang) application is built with the v . -prod command. To compile without the -prod flag, set ENVIRONMENT=development. You can choose a custom output binary name with the CC_V_BINARY environment variable, default is ${APP_HOME}/v_bin_${APP_ID}.

V (Vlang) version and tools

The currently deployed version of V (Vlang) on Clever Cloud is 0.4.11.

V scripts (.vsh), Clever Tasks

V (Vlang) can be used to execute shell scripts (.vsh). On Clever Cloud, to run such workloads as Clever Tasks, configure an application as Tasks from the Information panel in the Console or with Clever Tools:

clever create --type v --task "./your-script.vsh --and arguments"
clever deploy # or clever restart if there is no code change

Use Redirection.io as a proxy

Redirection.io can help reduce HTTP traffic issues on your website. It gives a complete control on how HTTP requests are handled, which helps make it SEO-friendly. It can perform redirections and comes with lots of features. You can link any application to a Redirection.io project easily, setting up the proxy mode with following environment variables:

NameDescriptionDefault value
CC_ENABLE_REDIRECTIONIOEnable Redirection.io supportfalse
CC_REDIRECTIONIO_PROJECT_KEYThe Redirection.io project key
CC_REDIRECTIONIO_FORWARD_PORTThe listening port of your application
CC_REDIRECTIONIO_INSTANCE_NAMEThe name of your application (optional)

The Redirection.io agent will start as a service, listen to 8080 port and forward the traffic to your application port.

Use Varnish as cache

Varnish is a powerful HTTP accelerator that can be used to cache your web application’s responses, improving performance and reducing load. To use it, create a Varnish configuration file in clevercloud/varnish.vcl and configure your application to listen on port 8081.

Last updated on

Did this documentation help you ?