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

add an option to disable serving #69

Merged
merged 1 commit into from
Aug 16, 2018
Merged

add an option to disable serving #69

merged 1 commit into from
Aug 16, 2018

Conversation

jsardev
Copy link
Contributor

@jsardev jsardev commented Aug 16, 2018

resolves #20

Copy link
Member

@allevo allevo left a comment

Choose a reason for hiding this comment

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

Hi!
thanks for this PR!

I have left some suggestions.

const pluginOptions = {
root: path.join(__dirname, '/static'),
prefix: '/static/',
serve: false
Copy link
Member

Choose a reason for hiding this comment

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

I think if you are not serving a directory, the root and prefix options is not needed at all.

Maybe this step can be skipped completely

const error = checkRootPathForErrors(opts.root)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For prefix: I agree, but root gives me the possibility to just pass a filename to reply.sendFile() instead of a absolute path.

Copy link
Member

@delvedor delvedor left a comment

Choose a reason for hiding this comment

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

LGTM

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

Copy link
Member

@allevo allevo 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 dea5c4e into fastify:master Aug 16, 2018
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.

Feature Request: sendFile without serving anything
4 participants