Skip to content

Commit

Permalink
chore: bump version to v0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cablehead committed Feb 20, 2025
1 parent b6ddae2 commit 26c04f5
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "http-nu"
version = "0.3.1-dev"
version = "0.4.0
edition = "2021"
description = "Serve a Nushell closure over HTTP."
license = "MIT"
Expand Down
44 changes: 44 additions & 0 deletions changes/v0.4.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# v0.4.0

## Highlights

### Serving Static Files

You can serve static files from a directory using the `.static` command. This
command takes two arguments: the root directory path and the request path.

When you call `.static`, it sets the response to serve the specified file, and
any subsequent output in the closure will be ignored. The content type is
automatically inferred based on the file extension (e.g., `text/css` for `.css`
files).

Here's an example:

```bash
$ http-nu :3001 '{|req| .static "/path/to/static/dir" $req.path}'
```

### TLS Support

Enable TLS by providing a PEM file containing both certificate and private key:

```bash
$ http-nu :3001 --tls cert.pem '{|req| "Secure Hello"}'
$ curl -k https://localhost:3001
Secure Hello
```

## Raw commits

- feat: add some basic request logging (2025-02-20)
- feat: add a .static built-in command to facilitate static file serving (#6)
(2025-02-20)
- fix: continue to serve if there's an error on accept (2025-02-13)
- feat: add tls support (#5) (2025-02-13)
- feat: log Nushell evaluation errors when processing a request (2025-02-13)
- fix: capture the output from external commands (2025-02-06)
- feat: move ResponseStartCommand to a thread_local pattern (2025-02-06)
- feat: preserve the environment from executing the code snippet which returns
the service closure ```nushell def do-foo [more: string] { "foo" + $more }
(2025-02-05)
- docs: README (2025-02-03)

0 comments on commit 26c04f5

Please sign in to comment.