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

Introduce Bootstrap #794

Merged
merged 1 commit into from
Jun 14, 2017
Merged

Introduce Bootstrap #794

merged 1 commit into from
Jun 14, 2017

Conversation

vkostyukov
Copy link
Collaborator

@vkostyukov vkostyukov commented Jun 12, 2017

This suppresses #583 and fixes #575.

The idea is pretty much the same. Here is the syntax example based on our TE benchmark:

val service = Bootstrap
  .serve[Application.Json](json)
  .serve[Text.Plain](plaintext)
  .toService

The reason I decided to call it Bootstrap is that I believe we would be able to add more machinery to it so users can configure a bunch of other things in their derived services. Examples:

This new Bootstrap type can also act as a config for our existing features. For example, we might think of providing a way to disable the Date header, supplied by default. Something along the lines (just using the case class copy method, somewhat close to what Circe does with Printers):

val service = Bootstrap.copy(includeDateHeader = false, includeServerHeader = true)
  .serve[Application.Json](foo)
  .toService

This is an experimental API and I'm not deprecating anything. The goal is to solicit users' feedback in 0.16 and see if it gets any adoption.

@codecov-io
Copy link

codecov-io commented Jun 12, 2017

Codecov Report

Merging #794 into master will increase coverage by 0.27%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #794      +/-   ##
==========================================
+ Coverage   79.17%   79.45%   +0.27%     
==========================================
  Files          44       45       +1     
  Lines         682      691       +9     
  Branches       30       22       -8     
==========================================
+ Hits          540      549       +9     
  Misses        142      142
Impacted Files Coverage Δ
...e/src/main/scala/io/finch/internal/ToService.scala 100% <100%> (ø) ⬆️
core/src/main/scala/io/finch/Endpoint.scala 73.07% <100%> (ø) ⬆️
core/src/main/scala/io/finch/Bootstrap.scala 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 05f6c5f...34c5c94. Read the comment docs.

@vkostyukov vkostyukov force-pushed the vk/bootstrap branch 2 times, most recently from 5fc4c74 to 769eafd Compare June 13, 2017 21:50
@vkostyukov vkostyukov merged commit bc5485f into master Jun 14, 2017
@vkostyukov vkostyukov deleted the vk/bootstrap branch June 14, 2017 18:53
@sergeykolbasov sergeykolbasov mentioned this pull request Oct 8, 2017
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support multiple content-types per service
2 participants