Skip to content

Releases: fluture-js/fluture-express

Version 6.0.1

01 May 08:33
6d13576
Compare
Choose a tag to compare

📜 #34 Fix mistakes in the documentation. This release only includes an updated README.

Version 6.0.0

27 Apr 05:36
5205beb
Compare
Choose a tag to compare

⚠️ #32 Changes the Body type (adding a new Json constructor), and the way equality between to values of type Body is determined.

Version 5.0.0

16 Apr 11:16
7375125
Compare
Choose a tag to compare

Version 5.0.0

This version is a partial rework of the library to allow users to use more of the features normally available in Express. See #31 for the changes in code.

✨ New Features

Most of Express' interface for modifiying the Response head is now available

There's also a new withoutHeader function to remove specific headers from a Response.

⚠️ Breaking Changes

The internal structure of the Response type changed

If you were manually interpreting values of type Response, for example by using the .cata method, then this change will affect you. For standard usage of this library, this change shouldn't affect you.

The middleware and dispatch functions now expect a curried input function

Instead of (req, locals) => /* Future Response */, middleware now looks like locals => req => /* Future Response */

-app.use (middleware ((req, locals) => (
+app.use (middleware (locals => req => (
   resolve (Empty)
))

The Stream constructor takes different arguments

  • It no longer takes the response code and the mime type as arguments.
  • It no longer takes a Readable instance directly, but rather a Future Error Readable. This allows the value created via the Stream constructor to be passed around safely (instances of Readable throw an error after a short timeout if no listerners are attached).
- Stream (202) ('image/jpeg') (fs.createReadStream ('./cat.jpeg'))
+ withStatus (202) (withType ('image/jpeg') (Stream (Future.ecanse (fs.createReadStream) ('./cat.jpeg'))))

The Json constructor no longer takes the response code

- Json (202) ({hello: world})
+ withStatus (202) (Json ({hello: world}))

The Render constructor no longer takes the response code

- Render (202) ('template') ({hello: world})
+ withStatus (202) (Render ('template') ({hello: world}))

The Redirect constructor no longer takes the response code

- Redirect (303) ('example.com')
+ withStatus (303) (Redirect ('example.com'))

Version 4.1.0

02 Apr 15:53
b4123aa
Compare
Choose a tag to compare

🛠️ Package metadata improvements: Expand Fluture version range, fix tags, exports, etc.

Version 4.0.0

30 Dec 14:34
2539ce6
Compare
Choose a tag to compare
  • #27 5c46482 Adds support for newer versions of Fluture
  • #28 Adds a Render constructor to the Response type that can be used to render templates