Skip to content

Conversation

@nwoltman
Copy link
Contributor

@nwoltman nwoltman commented Dec 20, 2017

Adds support for almost all of the options that serve-static supports, which are mostly just options that can be passed to send.


```

### Options
Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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
Copy link
Member

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?

Copy link
Contributor Author

@nwoltman nwoltman Dec 20, 2017

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
}
Copy link
Member

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.

@nwoltman nwoltman changed the title [WIP] Support almost all of the same options as serve-static Support almost all of the same options as serve-static Dec 20, 2017
@nwoltman
Copy link
Contributor Author

Added tests and updated the docs.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

LGTM

@mcollina mcollina merged commit ce7850d into fastify:master Dec 21, 2017
@nwoltman nwoltman deleted the send-options branch December 23, 2017 16:24
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.

2 participants