2018-09-13 18:25:30 +08:00
|
|
|
/* This is a JSON format configuration file
|
2019-03-25 17:44:22 +08:00
|
|
|
*/
|
2018-09-13 18:25:30 +08:00
|
|
|
{
|
2019-03-12 18:21:35 +08:00
|
|
|
/*
|
|
|
|
//ssl:The global ssl files setting
|
|
|
|
"ssl": {
|
|
|
|
"cert": "../../trantor/trantor/tests/server.pem",
|
|
|
|
"key": "../../trantor/trantor/tests/server.pem"
|
2018-09-13 18:25:30 +08:00
|
|
|
},
|
2019-03-12 18:21:35 +08:00
|
|
|
"listeners": [
|
|
|
|
{
|
|
|
|
//address: Ip address,0.0.0.0 by default
|
|
|
|
"address": "0.0.0.0",
|
|
|
|
//port: Port number
|
|
|
|
"port": 80,
|
|
|
|
//https: If true, use https for security,false by default
|
|
|
|
"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": [
|
|
|
|
{
|
|
|
|
//name: Name of the client,'default' by default
|
|
|
|
//"name":"",
|
|
|
|
//rdbms: Server type, postgresql,mysql or sqlite3, "postgresql" by default
|
|
|
|
"rdbms": "postgresql",
|
|
|
|
//filename: Sqlite3 db file name
|
|
|
|
//"filename":"",
|
|
|
|
//host: Server address,localhost by default
|
|
|
|
"host": "127.0.0.1",
|
|
|
|
//port: Server port, 5432 by default
|
|
|
|
"port": 5432,
|
|
|
|
//dbname: Database name
|
|
|
|
"dbname": "test",
|
|
|
|
//user: 'postgres' by default
|
|
|
|
"user": "",
|
|
|
|
//passwd: '' by default
|
|
|
|
"passwd": "",
|
2019-03-22 15:23:55 +08:00
|
|
|
//is_fast: false by default, if it is true, the client is faster but user can't call
|
|
|
|
//any synchronous interface of it.
|
2019-03-27 13:11:02 +08:00
|
|
|
"is_fast": false,
|
2019-03-22 15:23:55 +08:00
|
|
|
//connection_number: 1 by default, valid only if is_fast is false.
|
2019-03-12 18:21:35 +08:00
|
|
|
"connection_number": 1
|
|
|
|
}
|
|
|
|
],*/
|
|
|
|
"app": {
|
2019-03-25 17:44:22 +08:00
|
|
|
//threads_num: The number of IO threads, 1 by default, if the value is set to 0, the number of threads
|
2019-03-31 18:30:06 +08:00
|
|
|
//is the number of CPU cores
|
2019-03-12 18:21:35 +08:00
|
|
|
"threads_num": 1,
|
|
|
|
//enable_session: False by default
|
|
|
|
"enable_session": true,
|
|
|
|
"session_timeout": 0,
|
2019-03-25 17:44:22 +08:00
|
|
|
//document_root: Root path of HTTP document, defaut path is ./
|
2019-03-12 18:21:35 +08:00
|
|
|
"document_root": "./",
|
|
|
|
//upload_path: The path to save the uploaded file. "uploads" by default.
|
|
|
|
//If the path isn't prefixed with /, ./ or ../,
|
|
|
|
//it is relative path of document_root path
|
|
|
|
"upload_path": "uploads",
|
|
|
|
/* file_types:
|
2019-03-25 17:44:22 +08:00
|
|
|
* HTTP download file types,The file types supported by drogon
|
|
|
|
* by default are "html", "js", "css", "xml", "xsl", "txt", "svg",
|
|
|
|
* "ttf", "otf", "woff2", "woff" , "eot", "png", "jpg", "jpeg",
|
|
|
|
* "gif", "bmp", "ico", "icns", etc. */
|
2019-03-12 18:21:35 +08:00
|
|
|
"file_types": [
|
|
|
|
"gif",
|
|
|
|
"png",
|
|
|
|
"jpg",
|
|
|
|
"js",
|
|
|
|
"css",
|
|
|
|
"html",
|
|
|
|
"ico",
|
|
|
|
"swf",
|
|
|
|
"xap",
|
|
|
|
"apk",
|
|
|
|
"cur",
|
|
|
|
"xml"
|
2018-12-04 17:11:39 +08:00
|
|
|
],
|
2019-03-12 18:21:35 +08:00
|
|
|
//max_connections: Max connections number,100000 by default
|
|
|
|
"max_connections": 100000,
|
|
|
|
//max_connections_per_ip: Max connections number per clinet,0 by default which means no limit
|
|
|
|
"max_connections_per_ip": 0,
|
|
|
|
//Load_dynamic_views: False by default, when set to true, drogon
|
|
|
|
//compiles and loads dynamically "CSP View Files" in directories defined
|
|
|
|
//by "dynamic_views_path"
|
|
|
|
"load_dynamic_views": false,
|
|
|
|
//dynamic_views_path: If the path isn't prefixed with /, ./ or ../,
|
|
|
|
//it is relative path of document_root path
|
|
|
|
"dynamic_views_path": [
|
|
|
|
"./views"
|
|
|
|
],
|
|
|
|
//log: Set log output, drogon output logs to stdout by default
|
|
|
|
"log": {
|
|
|
|
//log_path: Log file path,empty by default,in which case,logs are output to the stdout
|
|
|
|
//"log_path": "./",
|
|
|
|
//logfile_base_name: Log file base name,empty by default which means drogon names logfile as
|
|
|
|
//drogon.log ...
|
|
|
|
"logfile_base_name": "",
|
|
|
|
//log_size_limit: 100000000 bytes by default,
|
|
|
|
//When the log file size reaches "log_size_limit", the log file is switched.
|
|
|
|
"log_size_limit": 100000000,
|
|
|
|
//log_level: "DEBUG" by default,options:"TRACE","DEBUG","INFO","WARN"
|
|
|
|
//The TRACE level is only valid when built in DEBUG mode.
|
|
|
|
"log_level": "DEBUG"
|
|
|
|
},
|
|
|
|
//run_as_daemon: False by default
|
|
|
|
"run_as_daemon": false,
|
|
|
|
//relaunch_on_error: False by default, if true, the program will be restart by the parent after exiting;
|
|
|
|
"relaunch_on_error": false,
|
|
|
|
//use_sendfile: True by default, if ture, the program
|
|
|
|
//uses sendfile() system-call to send static files to clients;
|
|
|
|
"use_sendfile": true,
|
|
|
|
//use_gzip: True by default, use gzip to compress the response body's content;
|
|
|
|
"use_gzip": true,
|
2019-03-25 17:44:22 +08:00
|
|
|
//static_files_cache_time: 5 (seconds) by default, the time in which the static file response is cached,
|
2019-03-12 18:21:35 +08:00
|
|
|
//0 means cache forever, the negative value means no cache
|
|
|
|
"static_files_cache_time": 5,
|
|
|
|
//simple_controllers_map: Used to configure mapping from path to simple controller
|
2019-03-25 17:44:22 +08:00
|
|
|
"simple_controllers_map": [{
|
|
|
|
"path": "/path/name",
|
|
|
|
"controller": "controllerClassName",
|
|
|
|
"http_methods": [
|
|
|
|
"get",
|
|
|
|
"post"
|
|
|
|
],
|
|
|
|
"filters": [
|
|
|
|
"FilterClassName"
|
|
|
|
]
|
|
|
|
}],
|
2019-03-12 18:21:35 +08:00
|
|
|
//idle_connection_timeout: Defaults to 60 seconds, the lifetime
|
|
|
|
//of the connection without read or write
|
|
|
|
"idle_connection_timeout": 60,
|
|
|
|
//server_header_field: Set the 'server' header field in each response sent by drogon,
|
|
|
|
//empty string by default with which the 'server' header field is set to "Server: drogon/version string\r\n"
|
|
|
|
"server_header_field": "",
|
|
|
|
//keepalive_requests: Sets the maximum number of requests that can be served through one keep-alive connection.
|
|
|
|
//After the maximum number of requests are made, the connection is closed.
|
|
|
|
//The default value of 0 means no limit.
|
|
|
|
"keepalive_requests": 0,
|
|
|
|
//pipeline_requests: Sets the maximum number of unhandled requests that can be cached in pipeline buffer.
|
|
|
|
//After the maximum number of requests are made, the connection is closed.
|
|
|
|
//The default value of 0 means no limit.
|
|
|
|
"pipeline_requests": 0
|
2019-03-25 17:44:22 +08:00
|
|
|
},
|
2019-03-29 15:34:14 +08:00
|
|
|
//plugins: Define all plugins running in the application
|
|
|
|
"plugins": [{
|
|
|
|
//name: The class name of the plugin
|
|
|
|
//"name": "TestPlugin",
|
|
|
|
//dependencies: Plugins that the plugin depends on. It can be commented out
|
|
|
|
"dependencies": [],
|
|
|
|
//config: The configuration of the plugin. This json object is the parameter to initialize the plugin.
|
|
|
|
//It can be commented out
|
|
|
|
"config": {
|
|
|
|
"heartbeat_interval": 2
|
|
|
|
}
|
|
|
|
|
|
|
|
}],
|
2019-03-25 17:44:22 +08:00
|
|
|
//custom_config: custom configuration for users. This object can be get by the app().getCustomConfig() method.
|
|
|
|
"custom_config": {}
|
2019-03-12 18:21:35 +08:00
|
|
|
}
|