|
@@ -6,27 +6,17 @@
|
|
"ssl": {
|
|
"ssl": {
|
|
"cert": "../../trantor/trantor/tests/server.pem",
|
|
"cert": "../../trantor/trantor/tests/server.pem",
|
|
"key": "../../trantor/trantor/tests/server.pem"
|
|
"key": "../../trantor/trantor/tests/server.pem"
|
|
- },
|
|
|
|
|
|
+ },*/
|
|
"listeners": [
|
|
"listeners": [
|
|
{
|
|
{
|
|
//address:ip address,0.0.0.0 by default
|
|
//address:ip address,0.0.0.0 by default
|
|
"address": "0.0.0.0",
|
|
"address": "0.0.0.0",
|
|
//port:port number
|
|
//port:port number
|
|
- "port": 80,
|
|
|
|
|
|
+ "port": 8080,
|
|
//https:if use https for security,false by default
|
|
//https:if use https for security,false by default
|
|
"https": false
|
|
"https": false
|
|
- },
|
|
|
|
- {
|
|
|
|
- "address": "0.0.0.0",
|
|
|
|
- "port": 443,
|
|
|
|
- "https": true,
|
|
|
|
- //cert,key:cert file path and key file path,empty by default,
|
|
|
|
- //if empty,use global setting
|
|
|
|
- "cert": "",
|
|
|
|
- "key": ""
|
|
|
|
}
|
|
}
|
|
- ],*/
|
|
|
|
- /*
|
|
|
|
|
|
+ ],
|
|
"db_clients": [
|
|
"db_clients": [
|
|
{
|
|
{
|
|
//name:Name of the client,'default' by default
|
|
//name:Name of the client,'default' by default
|
|
@@ -34,22 +24,22 @@
|
|
//rdbms:server type, "postgreSQL" by default
|
|
//rdbms:server type, "postgreSQL" by default
|
|
"rdbms": "postgreSQL",
|
|
"rdbms": "postgreSQL",
|
|
//host:server address,localhost by default
|
|
//host:server address,localhost by default
|
|
- "host": "127.0.0.1",
|
|
|
|
|
|
+ "host": "tfb-database",
|
|
//port:server port, 5432 by default
|
|
//port:server port, 5432 by default
|
|
"port": 5432,
|
|
"port": 5432,
|
|
//dbname:Database name
|
|
//dbname:Database name
|
|
- "dbname": "test",
|
|
|
|
|
|
+ "dbname": "hello_world",
|
|
//user:'postgres' by default
|
|
//user:'postgres' by default
|
|
- "user": "",
|
|
|
|
|
|
+ "user": "benchmarkdbuser",
|
|
//passwd:'' by default
|
|
//passwd:'' by default
|
|
- "passwd": "",
|
|
|
|
|
|
+ "passwd": "benchmarkdbpass",
|
|
//connection_number:1 by default
|
|
//connection_number:1 by default
|
|
"connection_number": 1
|
|
"connection_number": 1
|
|
}
|
|
}
|
|
- ],*/
|
|
|
|
|
|
+ ],
|
|
"app": {
|
|
"app": {
|
|
//threads_num:the number of IO threads,1 by default, if the value is set to 0, the number of threads
|
|
//threads_num:the number of IO threads,1 by default, if the value is set to 0, the number of threads
|
|
-< //will be the number of processors.
|
|
|
|
|
|
+ //will be the number of processors.
|
|
"threads_num": 0,
|
|
"threads_num": 0,
|
|
//enable_session:false by default
|
|
//enable_session:false by default
|
|
"enable_session": false,
|
|
"enable_session": false,
|
|
@@ -89,7 +79,7 @@
|
|
//log:set log output,drogon output logs to stdout by default
|
|
//log:set log output,drogon output logs to stdout by default
|
|
"log": {
|
|
"log": {
|
|
//log_path:log file path,empty by default,in which case,log will output to the stdout
|
|
//log_path:log file path,empty by default,in which case,log will output to the stdout
|
|
- "log_path": "./",
|
|
|
|
|
|
+ //"log_path": "./",
|
|
//logfile_base_name:log file base name,empty by default which means drogon will name logfile as
|
|
//logfile_base_name:log file base name,empty by default which means drogon will name logfile as
|
|
//drogon.log ...
|
|
//drogon.log ...
|
|
"logfile_base_name": "",
|
|
"logfile_base_name": "",
|
|
@@ -98,7 +88,7 @@
|
|
"log_size_limit": 100000000,
|
|
"log_size_limit": 100000000,
|
|
//log_level:"DEBUG" by default,options:"TRACE","DEBUG","INFO","WARN"
|
|
//log_level:"DEBUG" by default,options:"TRACE","DEBUG","INFO","WARN"
|
|
//The TRACE level is only valid when built in DEBUG mode.
|
|
//The TRACE level is only valid when built in DEBUG mode.
|
|
- "log_level": "DEBUG"
|
|
|
|
|
|
+ "log_level": "WARN"
|
|
},
|
|
},
|
|
//run_as_daemon:false by default
|
|
//run_as_daemon:false by default
|
|
"run_as_daemon": false,
|
|
"run_as_daemon": false,
|
|
@@ -108,26 +98,54 @@
|
|
//use sendfile() system-call to send static file to client;
|
|
//use sendfile() system-call to send static file to client;
|
|
"use_sendfile": true,
|
|
"use_sendfile": true,
|
|
//use_gzip:true by default,use gzip to compress the response body's content;
|
|
//use_gzip:true by default,use gzip to compress the response body's content;
|
|
- "use_gzip": true,
|
|
|
|
|
|
+ "use_gzip": false,
|
|
//static_files_cache_time:5 (seconds) by default,the time in which static file response is cached,
|
|
//static_files_cache_time:5 (seconds) by default,the time in which static file response is cached,
|
|
//0 means cache forever,the negative value means no cache
|
|
//0 means cache forever,the negative value means no cache
|
|
"static_files_cache_time": 5,
|
|
"static_files_cache_time": 5,
|
|
//simple_controllers_map:Configuring mapping from path to simple controller
|
|
//simple_controllers_map:Configuring mapping from path to simple controller
|
|
"simple_controllers_map": [
|
|
"simple_controllers_map": [
|
|
{
|
|
{
|
|
- "path": "/path/name",
|
|
|
|
- "controller": "controllerClassName",
|
|
|
|
|
|
+ "path": "/plaintext",
|
|
|
|
+ "controller": "PlaintextCtrl",
|
|
"http_methods": [
|
|
"http_methods": [
|
|
- "get",
|
|
|
|
- "post"
|
|
|
|
|
|
+ "get"
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ "path": "/json",
|
|
|
|
+ "controller": "JsonCtrl",
|
|
|
|
+ "http_methods": [
|
|
|
|
+ "get"
|
|
],
|
|
],
|
|
- "filters": [
|
|
|
|
- "FilterClassName"
|
|
|
|
|
|
+ "filters": []
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ "path": "/db",
|
|
|
|
+ "controller": "DbCtrl",
|
|
|
|
+ "http_methods": [
|
|
|
|
+ "get"
|
|
|
|
+ ],
|
|
|
|
+ "filters": []
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ "path": "/fortunes",
|
|
|
|
+ "controller": "FortuneCtrl",
|
|
|
|
+ "http_methods": [
|
|
|
|
+ "get"
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ "path": "/queries",
|
|
|
|
+ "controller": "QueriesCtrl",
|
|
|
|
+ "http_methods": [
|
|
|
|
+ "get"
|
|
]
|
|
]
|
|
}
|
|
}
|
|
],
|
|
],
|
|
//idle_connection_timeout: defaults to 60 seconds, the lifetime
|
|
//idle_connection_timeout: defaults to 60 seconds, the lifetime
|
|
//of the connection without read or write
|
|
//of the connection without read or write
|
|
- "idle_connection_timeout": 60
|
|
|
|
|
|
+ "idle_connection_timeout": 60,
|
|
|
|
+ //enable_fast_db_client: Defaults to false
|
|
|
|
+ "enable_fast_db_client": true
|
|
}
|
|
}
|
|
}
|
|
}
|