Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

accept options in the Application constructor #1372

Merged
merged 5 commits into from
Aug 19, 2019

Conversation

djake
Copy link
Contributor

@djake djake commented Aug 15, 2019

Accept an options object on the application constructor to configure app.env, app.proxy, app.keys, and app.subdomainOffset.

#1370

@codecov
Copy link

codecov bot commented Aug 15, 2019

Codecov Report

Merging #1372 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #1372   +/-   ##
======================================
  Coverage     100%    100%           
======================================
  Files           4       4           
  Lines         377     378    +1     
======================================
+ Hits          377     378    +1
Impacted Files Coverage Δ
lib/application.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d1d65dd...dd13f2a. Read the comment docs.

@dead-horse
Copy link
Member

Update the document https://github.com/koajs/koa/blob/master/docs/api/index.md#application ?

* @param {object} [options] Application options
* @param {string} [options.env='development'] Environment
* @param {string[]} [options.keys] Signed cookie keys
* @param {string} [options.proxy] Trust proxy headers
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

options.proxy is not a string, but a boolean

* @param {string} [options.proxy] Trust proxy headers
* @param {number} [options.subdomainOffset] Subdomain offset
*
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency, add a newline between constructor-method and */.

Copy link
Contributor

@fl0w fl0w left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dead-horse dead-horse merged commit 5afff89 into koajs:master Aug 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants