-
-
Notifications
You must be signed in to change notification settings - Fork 110
Support almost all of the same options as serve-static #24
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
Conversation
|
|
||
| ``` | ||
|
|
||
| ### Options |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we link to the options in send docs instead? I’m not a fun of duplicating them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. Would you like me to keep the descriptions for the Fastify options though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes!
index.js
Outdated
| immutable: opts.immutable, | ||
| index: opts.index, | ||
| lastModified: opts.lastModified, | ||
| maxAge: opts.maxAge || 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is 0 the default applied in send?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yes. I guess the || 0 isn’t necessary then.
| index: opts.index, | ||
| lastModified: opts.lastModified, | ||
| maxAge: opts.maxAge || 0 | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a unit test (maybe using proxyquire)? So we can test that the options are passed through.
2f2d5ea to
08b1ee4
Compare
|
Added tests and updated the docs. |
mcollina
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Adds support for almost all of the options that
serve-staticsupports, which are mostly just options that can be passed tosend.