-
Notifications
You must be signed in to change notification settings - Fork 3
Core directives
Cheikh Seck edited this page Dec 17, 2018
·
9 revisions
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.
The following directives allow users to define RESTful HTTP APIs.
Directive server is used to define servers or applications (if deploying to App engine).
Directive name | Type | Parent |
---|---|---|
server | Server | ROOT |
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");
}
}
Please check back in a few days :).