Server API
Last updated
Was this helpful?
Last updated
Was this helpful?
options 类型,一个options对象
options.name - 类型,服务的名字 (可选, 默认值"restify"
)
options.dtrace -类型, 启用dTrace支持 (可选, 默认值: false)
options.log -类型, 实例. (可选, 默认值: bunyan.createLogger(options.name||"restify"))
options.url -类型,一旦调用listen() , 这将在服务器运行的地方填写。
options.certificate -( | )类型, 如果要创建HTTPS服务器,请传递一个PEM编码证书和密钥。
options.key -( | )类型,如果要创建HTTPS服务器,请传递一个PEM编码证书和密钥。
options.formatters -类型, 用于res.send()的自定义响应格式化程序。
options.handleUncaughtExceptions -类型, 当restify将使用一个域来捕获和响应在它的处理程序堆栈中发生的任何异常异常。bunyan实例,响应头,默认是restify,通过空字符串来设置标题。有显著的负面的性能影响。 (可选, 默认值: false)
options.spdy -类型, Any options accepted by node-spdy.
options.http2 -类型,Any options accepted by http2.createSecureServer.
options.handleUpgrades -类型, Hook the upgrade event from the node HTTP server, pushing Connection: Upgrade requests through the regular request handling chain. (可选, 默认值: false)
options.onceNext -类型, Prevents calling next multiple times (可选, 默认值: false)
options.strictNext -类型,Throws error when next() is called more than once, enabled onceNext option (可选, 默认值: false)
options.httpsServerOptions -类型, Any options accepted by node-https Server. If provided the following restify server options will be ignored: spdy, ca, certificate, key, passphrase, rejectUnauthorized, requestCert and ciphers; however these can all be specified on httpsServerOptions.
options.noWriteContinue -类型, prevents res.writeContinue() in server.on('checkContinue') when proxing (可选, 默认值: false)
options.ignoreTrailingSlash -类型, ignore trailing slash on paths (可选, 默认值: false)
返回 server 类型