Skip to content

Core directives

Cheikh Seck edited this page Dec 17, 2018 · 9 revisions

Directives

This page covers the core samb directives. Syntax examples will be displayed for YAML and samb (.se) files. Each directive will have a table, the table will display the directive's name, type and parent. The parent of a directive specifies where it is nested. If ROOT is specified as the parent, the directive should be placed at the root of your file.

HTTP requests

The following directives allow users to define RESTful HTTP APIs.

Server

Directive server is used to define servers or applications (if deploying to App engine).

Directive name Type Parent
server Server ROOT

Attributes

Name Type Description
host string The hostname the server should bind to. (if not deploying to app engine)
port string The port the server should listen on. (if not deploying to app engine)
require string array Other samb route definitions to import.

YAML sample :

...
server: 
  host: 127.0.0.1
  port: 8081
  # Import web route definitions
  require : ["./endpoints.yml"]

  start:
    do:
      - println("HelloWorld")
      - println("Starting...")
...

.SE sample :

server {
    host 127.0.0.1;
    port 8080;

    # Import web route definitions
    require "./endpoints.se";
    require "./endpoints_two.se";


    start {
    	do println("Hello");
    }

    shutdown {
    	do println("Bye");
    }  
}

WIP

Please check back in a few days :).

Clone this wiki locally