drogon/config.example.json

141 lines
4.8 KiB
JSON
Raw Normal View History

2018-09-13 10:25:30 +00:00
/* This is a JSON format configuration file
*/
{
2019-01-31 02:23:12 +00:00
//ssl:The global ssl files setting
/*
2018-09-13 10:25:30 +00:00
"ssl": {
"cert": "../../trantor/trantor/tests/server.pem",
"key": "../../trantor/trantor/tests/server.pem"
},
"listeners": [
{
2019-01-31 02:23:12 +00:00
//address: Ip address,0.0.0.0 by default
2018-09-13 10:25:30 +00:00
"address": "0.0.0.0",
2019-01-31 02:23:12 +00:00
//port: Port number
2018-09-13 10:25:30 +00:00
"port": 80,
2019-01-31 02:23:12 +00:00
//https: If true, use https for security,false by default
2018-09-13 10:25:30 +00:00
"https": false
},
{
"address": "0.0.0.0",
"port": 443,
"https": true,
2019-01-31 02:23:12 +00:00
//cert,key: Cert file path and key file path, empty by default,
//if empty, use global setting
2018-09-13 10:25:30 +00:00
"cert": "",
"key": ""
}
2018-12-04 09:11:39 +00:00
],
"db_clients": [
{
2019-01-31 02:23:12 +00:00
//name: Name of the client,'default' by default
//"name":"",
2019-01-31 02:23:12 +00:00
//rdbms: Server type, postgresql,mysql or sqlite3, "postgresql" by default
2018-12-02 08:53:44 +00:00
"rdbms": "postgresql",
2019-01-31 02:23:12 +00:00
//filename: Sqlite3 db file name
//"filename":"",
2019-01-31 02:23:12 +00:00
//host: Server address,localhost by default
"host": "127.0.0.1",
2019-01-31 02:23:12 +00:00
//port: Server port, 5432 by default
"port": 5432,
2019-01-31 02:23:12 +00:00
//dbname: Database name
"dbname": "test",
2019-01-31 02:23:12 +00:00
//user: 'postgres' by default
"user": "",
2019-01-31 02:23:12 +00:00
//passwd: '' by default
"passwd": "",
2019-01-31 02:23:12 +00:00
//connection_number: 1 by default
2018-12-04 09:11:39 +00:00
"connection_number": 1
}
2018-12-04 09:11:39 +00:00
],*/
2018-09-13 10:25:30 +00:00
"app": {
2019-01-31 02:23:12 +00:00
//threads_num: The number of IO threads,1 by default, if the value is set to 0, the number of threads
2018-12-17 06:22:25 +00:00
//will be the number of processors.
"threads_num": 1,
2019-01-31 02:23:12 +00:00
//enable_session: False by default
2019-01-02 08:13:36 +00:00
"enable_session": true,
2018-12-04 09:11:39 +00:00
"session_timeout": 0,
2019-01-31 02:23:12 +00:00
//document_root: Root path of HTTP document,defaut path is ./
"document_root": "./",
2018-11-26 08:36:57 +00:00
//upload_path: The path to save the uploaded file. "uploads" by default.
2018-12-04 09:11:39 +00:00
//If the path isn't prefixed with /, ./ or ../,
2018-11-26 08:36:57 +00:00
//it will be relative path of document_root path
2018-12-04 09:11:39 +00:00
"upload_path": "uploads",
2018-09-13 10:25:30 +00:00
/* file_types:
* 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. */
"file_types": [
"gif",
"png",
"jpg",
"js",
"css",
"html",
"ico",
"swf",
"xap",
"apk",
"cur",
"xml"
],
2019-01-31 02:23:12 +00:00
//max_connections: Max connections number,100000 by default
"max_connections": 100000,
2019-01-31 02:23:12 +00:00
//max_connections_per_ip: Max connections number per clinet,0 by default which means no limit
"max_connections_per_ip": 0,
2019-01-31 02:23:12 +00:00
//Load_dynamic_views: False by default, when set to true, drogon will
2018-09-13 10:25:30 +00:00
//compile and load dynamically "CSP View Files" in directories defined
//by "dynamic_views_path"
2018-12-04 09:11:39 +00:00
"load_dynamic_views":false,
2019-01-31 02:23:12 +00:00
//dynamic_views_path: If the path isn't prefixed with /, ./ or ../,
2018-09-16 03:50:29 +00:00
//it will be relative path of document_root path
2018-12-04 09:11:39 +00:00
"dynamic_views_path":["./views"],
2019-01-31 02:23:12 +00:00
//log: Set log output, drogon output logs to stdout by default
"log": {
2019-01-31 02:23:12 +00:00
//log_path: Log file path,empty by default,in which case,log will output to the stdout
2018-10-24 08:10:28 +00:00
//"log_path": "./",
2019-01-31 02:23:12 +00:00
//logfile_base_name: Log file base name,empty by default which means drogon will name logfile as
2018-09-13 10:25:30 +00:00
//drogon.log ...
"logfile_base_name": "",
2019-01-31 02:23:12 +00:00
//log_size_limit: 100000000 bytes by default,
2018-10-02 09:20:32 +00:00
//When the log file size reaches "log_size_limit", the log file will be switched.
"log_size_limit": 100000000,
2019-01-31 02:23:12 +00:00
//log_level: "DEBUG" by default,options:"TRACE","DEBUG","INFO","WARN"
2018-10-06 02:15:46 +00:00
//The TRACE level is only valid when built in DEBUG mode.
2019-01-31 02:23:12 +00:00
"log_level": "DEBUG"
2018-09-13 10:25:30 +00:00
},
2019-01-31 02:23:12 +00:00
//run_as_daemon: False by default
"run_as_daemon": false,
2019-01-31 02:23:12 +00:00
//relaunch_on_error: False by default, if true, the program will be restart by the parent after exiting;
"relaunch_on_error": false,
2019-01-31 02:23:12 +00:00
//use_sendfile: True by default, if ture, the program will
//use sendfile() system-call to send static file to the client;
"use_sendfile": true,
2019-01-31 02:23:12 +00:00
//use_gzip: True by default,use gzip to compress the response body's content;
2018-10-15 05:34:38 +00:00
"use_gzip": true,
2019-01-31 02:23:12 +00:00
//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
"static_files_cache_time": 5,
2019-01-31 02:23:12 +00:00
//simple_controllers_map: Used to configure mapping from path to simple controller
"simple_controllers_map": [
{
"path": "/path/name",
"controller": "controllerClassName",
2018-12-04 09:11:39 +00:00
"http_methods": [
"get",
"post"
],
"filters": [
"FilterClassName"
]
}
2018-10-24 08:10:28 +00:00
],
2019-01-31 02:23:12 +00:00
//idle_connection_timeout: Defaults to 60 seconds, the lifetime
2018-10-24 08:10:28 +00:00
//of the connection without read or write
"idle_connection_timeout": 60,
//enable_fast_db_client: Defaults to false
"enable_fast_db_client": false
2018-09-13 10:25:30 +00:00
}
2018-12-17 06:22:25 +00:00
}