limit number or string representing the request size limit (10mb)
strict when set to true, JSON parser will only accept arrays and objects; when false will accept anything JSON.parse accepts. Defaults to true. (also strict mode will always return object).
queryString an object of options when parsing query strings and form data. See qs for more information.
jsonTypes is used to determine what media type co-body will parse as json, this option is passed directly to the type-is library.
formTypes is used to determine what media type co-body will parse as form, this option is passed directly to the type-is library.
textTypes is used to determine what media type co-body will parse as text, this option is passed directly to the type-is library.
bytesExpected --{Integer}-- The expected number of bytes in this form, default null
maxFields --{Integer}-- Limits the number of fields that the querystring parser will decode, default 1000
maxFieldsSize --{Integer}-- Limits the amount of memory all fields together (except files) can allocate in bytes. If this value is exceeded, an 'error' event is emitted, default 2mb (2 - 2 - 1024)
uploadDir --{String}-- Sets the directory for placing file uploads in, default os.tmpDir()
keepExtensions --{Boolean}-- Files written to uploadDir will include the extensions of the original files, default false
hash --{String}-- If you want checksums calculated for incoming files, set this to either 'sha1' or 'md5', default false
multiples --{Boolean}-- Multiple file uploads or no, default true
onFileBegin --{Function}-- Special callback on file begin. The function is executed directly by formidable. It can be used to rename files before saving them to disk. See the docs
root 根目录. nothing above this root directory can be served
opts 配置
defer 是否滞后处理 (defaults to false)
maxage 浏览器缓存 max-age 毫秒. (defaults to 0)
hidden 是否响应隐藏文件 (defaults to false)
gzip 开启 gzip (defaults to true)
format If not false (defaults to true), format the path to serve static file servers and not require a trailing slash for directories, so that you can do both /directory and /directory/
setHeaders Function to set custom headers on response.
maxAge a number representing the milliseconds from Date.now() for expiry
expires a Date object indicating the cookie's expiration date (expires at the end of session by default).
path a string indicating the path of the cookie (/ by default).
domain a string indicating the domain of the cookie (no default).
secure a boolean indicating whether the cookie is only to be sent over HTTPS (false by default for HTTP, true by default for HTTPS). Read more about this option below.
httpOnly a boolean indicating whether the cookie is only to be sent over HTTP(S), and not made available to client JavaScript (true by default).
sameSite a boolean or string indicating whether the cookie is a "same site" cookie (false by default). This can be set to 'strict', 'lax', or true (which maps to 'strict').
signed a boolean indicating whether the cookie is to be signed (false by default). If this is true, another cookie of the same name with the .sig suffix appended will also be sent, with a 27-byte url-safe base64 SHA1 value representing the hash of cookie-name=cookie-value against the first Keygrip key. This signature key is used to detect tampering the next time a cookie is received.
overwrite a boolean indicating whether to overwrite previously set cookies of the same name (false by default). If this is true, all cookies set during the same request with the same name (regardless of path or domain) are filtered out of the Set-Cookie header when setting this cookie.