You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Welcome to http4s-stir, a library designed to bridge the gap between Pekko HTTP (Akka HTTP) and http4s. This README provides an overview of the library, its usage, project status, and more.
http4s-stir offers [Pekko HTTP](https://github.com/apache/incubator-pekko-http)-style (Akka HTTP-style) DSL directives for [http4s](https://github.com/http4s/http4s)using cats-effect's IO as an effect system. About 85% of all directives have been ported. Some were omitted due to a lack of support in http4s, while others were modified to fit http4s' distinct architecture. For specifics, refer to the [Missing](#missing) section below.
6
+
[Pekko HTTP](https://github.com/apache/incubator-pekko-http) (Akka HTTP) style DSL directives for [http4s](https://github.com/http4s/http4s)with cats-effect IO. About 85% of all directives have been ported. Includes a test kit similar to Pekko's.
6
7
7
-
Additionally, there's a compatibility layer, [`Http4sDirectives`](https://github.com/theiterators/http4s-stir/blob/master/core/src/main/scala/pl/iterators/stir/server/directives/Http4sDirectives.scala), for http4s-dsl routes.
8
+
Cross-compiled for JVM, Scala.js, and Scala Native. Supports Scala 2.13 and Scala 3.
8
9
9
-
http4s-stir also furnishes a test kit akin to Pekko's (Akka's).
@@ -145,95 +127,45 @@ class MainRoutesSpec extends Specification with Specs2RouteTest {
145
127
}
146
128
}
147
129
}
148
-
149
130
```
150
131
151
-
To run the tests you can use `scala-cli test .`.
152
-
153
-
For a more comprehensive example showcasing additional directives see [examples](https://github.com/theiterators/http4s-stir/blob/master/examples/src/main/scala/Service.scala). You can run it with `~examples/reStart`.
154
-
155
-
## Why this library?
156
-
157
-
Here's why I embarked on this project:
158
-
159
-
- After the license change for Akka, many contemplated transitioning to http4s and the Typelevel stack. I wanted to simplify this migration.
160
-
- While I'm a fan of cats-effect, I find the http4s DSL verbose and clunky. Marrying Pekko HTTP (Akka HTTP) with cats-effect seemed inelegant, so http4s-stir could be the remedy.
161
-
- I was curious about the internals of both Pekko HTTP and http4s and wanted to determine the feasibility of this project.
162
-
- And, of course, a bit of playful provocation - [see the next section](#whats-with-the-name).
132
+
Run with `scala-cli test .`.
163
133
164
-
## What's with the name?
165
-
166
-
> **stir something up** (pv)
167
-
>
168
-
> *to cause an unpleasant emotion or problem to begin or grow*
134
+
For a more comprehensive example showcasing additional directives, see [examples/Service.scala](https://github.com/theiterators/http4s-stir/blob/master/examples/src/main/scala/Service.scala). Run it locally with `sbt ~examples/reStart`.
169
135
170
-
There are folks who adore http4s but detest Pekko's (or Akka's) DSL. Conversely, there are those who champion Pekko's (or Akka's) but disdain http4s DSL. I aimed to ruffle feathers from both camps with a hybrid library.
136
+
## http4s-dsl compatibility
171
137
172
-
## Project status
138
+
There's a compatibility layer, [`Http4sDirectives`](https://github.com/theiterators/http4s-stir/blob/master/core/src/main/scala/pl/iterators/stir/server/directives/Http4sDirectives.scala), that lets you embed existing http4s-dsl routes within stir routes.
173
139
174
-
This library is in preview, intended to collect initial feedback. Yet, I am dedicated to its ongoing maintenance and enhancement, especially as it undergoes real-world testing. Contributions are very welcome.
140
+
## What's missing
175
141
176
-
## Missing
142
+
Some Pekko HTTP directives are absent or modified:
177
143
178
-
Certain directives from the original are either absent or have been modified:
179
-
180
-
* Assuming and converting to/from strict entity
181
-
*`CacheConditionDirectives`
182
-
*`CodingDirectives`
183
-
* directory listing in `FileAndResourceDirectives`
* Testkit differences: synchronous execution, no chunk support, limited request building, no WebSocket testing
208
152
209
-
If you run into any issues, unexpected behavior, or errors, we encourage you to report them. Your feedback is invaluable and helps us improve.
210
-
211
-
### Have a Feature Request?
212
-
213
-
If there's a feature you'd like to see, or if you have an idea that would make this project even better, we'd love to hear about it!
214
-
215
-
### How to Report an Issue or Feature Request
216
-
217
-
Please create a new issue in our [http4-stir](https://github.com/theiterators/http4s-stir/issues). Ensure you provide as much detail as possible:
153
+
## What's with the name?
218
154
219
-
1.**For issues:**
220
-
- Describe the issue you're facing.
221
-
- Steps to reproduce.
222
-
- Expected behavior.
223
-
- Actual behavior.
155
+
> **stir something up** (pv)
156
+
>
157
+
> *to cause an unpleasant emotion or problem to begin or grow*
224
158
225
-
2.**For feature requests:**
226
-
- Describe the feature and why you believe it would be useful.
227
-
- Any reference or example from other projects/tools, if applicable.
159
+
Some love http4s DSL but dislike Pekko's. Others feel the opposite. This library stirs things up by combining both.
228
160
229
-
By providing detailed information, you'll help us address your concerns more efficiently.
161
+
## Contributing
230
162
231
-
Thank you for your contributions and for helping make this project better for everyone!
163
+
Issues and PRs welcome at [github.com/theiterators/http4s-stir](https://github.com/theiterators/http4s-stir/issues).
232
164
233
165
## License
234
166
235
-
http4s-stir is under the Apache License, Version 2.0 ("the License"). You must comply with this License to use this software. A [full license text](https://github.com/theiterators/http4s-stir/blob/master/LICENSE) is available in the repository.
167
+
Apache License2.0. See [LICENSE](https://github.com/theiterators/http4s-stir/blob/master/LICENSE).
236
168
237
169
## Acknowledgements
238
170
239
-
http4s-stir incorporates significant portions of code adapted from [Pekko HTTP](https://github.com/apache/incubator-pekko-http), a fork of [Akka HTTP](https://github.com/akka/akka-http).
171
+
http4s-stir incorporates code adapted from [Pekko HTTP](https://github.com/apache/incubator-pekko-http), a fork of [Akka HTTP](https://github.com/akka/akka-http).
0 commit comments