Skip to content

Commit f4300e9

Browse files
committed
v2.0.0
1 parent ea7ee3e commit f4300e9

File tree

5 files changed

+19
-24
lines changed

5 files changed

+19
-24
lines changed

CHANGELOG.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Changelog
22

3-
## v1.1.1 - Unreleased
3+
## v2.0.0 - Unreleased
4+
5+
- Updated for `gleam_otp` v0.5.0.
6+
7+
## v1.1.1 - 2022-02-17
48

59
- Fixed a bug where the request host field could have an incorrect value.
610
- Fixed a bug where the request path field could also include the query.

gleam.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name = "gleam_elli"
2-
version = "1.1.1"
2+
version = "2.0.0"
33
licences = ["Apache-2.0"]
44
description = "Run Gleam HTTP services with the Elli web server"
55

manifest.toml

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
packages = [
55
{ name = "certifi", version = "2.9.0", build_tools = ["rebar3"], requirements = [], otp_app = "certifi", source = "hex", outer_checksum = "266DA46BDB06D6C6D35FDE799BCB28D36D985D424AD7C08B5BB48F5B5CDD4641" },
66
{ name = "elli", version = "3.3.0", build_tools = ["rebar3"], requirements = [], otp_app = "elli", source = "hex", outer_checksum = "698B13B33D05661DB9FE7EFCBA41B84825A379CCE86E486CF6AFF9285BE0CCF8" },
7-
{ name = "gleam_erlang", version = "0.9.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "E5AF86B3EC852CE14058D14A1A17CC73344651B4DE2D99FA1D4E907E9F2D1D19" },
8-
{ name = "gleam_hackney", version = "0.2.0", build_tools = ["gleam"], requirements = ["hackney", "gleam_http", "gleam_stdlib"], otp_app = "gleam_hackney", source = "hex", outer_checksum = "560B3577E24F4105BB0EFEC24BB97E7CD8F1F4C8AA62A3AAC8FA6226F35DE8E4" },
9-
{ name = "gleam_http", version = "3.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_http", source = "hex", outer_checksum = "FB65B42C7AF4C14F1DC0AD9A3ABCE50E9486D3F8D0A42C9E52A2B8BD651739DF" },
10-
{ name = "gleam_otp", version = "0.3.1", build_tools = ["gleam"], requirements = ["gleam_stdlib", "gleam_erlang"], otp_app = "gleam_otp", source = "hex", outer_checksum = "9F779074D0CD3760E280E24247BA17FC673D654234D56B3A8F187DC8FDE299B7" },
11-
{ name = "gleam_stdlib", version = "0.19.3", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "CA579C2FF0621E93FF6EFEF61BAFFCF0505732BA073F616E28878042F1A1F401" },
12-
{ name = "gleeunit", version = "0.6.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "5BF486C3E135B7F5ED8C054925FC48E5B2C79016A39F416FD8CF2E860520EE55" },
13-
{ name = "hackney", version = "1.18.1", build_tools = ["rebar3"], requirements = ["parse_trans", "certifi", "idna", "mimerl", "metrics", "ssl_verify_fun", "unicode_util_compat"], otp_app = "hackney", source = "hex", outer_checksum = "A4ECDAFF44297E9B5894AE499E9A070EA1888C84AFDD1FD9B7B2BC384950128E" },
7+
{ name = "gleam_erlang", version = "0.15.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "0C22868854FBF76F16D5B8BEFCC58C4EEAB85FF0C37214CFD06C2E3A56ACB2AC" },
8+
{ name = "gleam_hackney", version = "0.2.1", build_tools = ["gleam"], requirements = ["gleam_http", "gleam_stdlib", "hackney"], otp_app = "gleam_hackney", source = "hex", outer_checksum = "CCACA00027C827436D8EB945651392B6E5798CFC9E69907A28BE61832B0C02A4" },
9+
{ name = "gleam_http", version = "3.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_http", source = "hex", outer_checksum = "8E0A96A56CB5870252EACB4860B8BC2AF755F5E13F4AB99970C572C5BB315053" },
10+
{ name = "gleam_otp", version = "0.5.0", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_stdlib"], otp_app = "gleam_otp", source = "hex", outer_checksum = "43CDB5284EEFEE6E006A3B067E23E567ACE1224A72487491E47708FB506CC8F7" },
11+
{ name = "gleam_stdlib", version = "0.22.3", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "F2C2D389B06426E1289D5419F89BDE8E0F7F35A40B2BBB3C88188481F0D44A9F" },
12+
{ name = "gleeunit", version = "0.6.2", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "A006864621DB80C4FBB0746580703502FD81A4D38D23FCB20A8120984D353DF0" },
13+
{ name = "hackney", version = "1.18.1", build_tools = ["rebar3"], requirements = ["metrics", "certifi", "mimerl", "parse_trans", "unicode_util_compat", "ssl_verify_fun", "idna"], otp_app = "hackney", source = "hex", outer_checksum = "A4ECDAFF44297E9B5894AE499E9A070EA1888C84AFDD1FD9B7B2BC384950128E" },
1414
{ name = "idna", version = "6.1.1", build_tools = ["rebar3"], requirements = ["unicode_util_compat"], otp_app = "idna", source = "hex", outer_checksum = "92376EB7894412ED19AC475E4A86F7B413C1B9FBB5BD16DCCD57934157944CEA" },
1515
{ name = "metrics", version = "1.0.1", build_tools = ["rebar3"], requirements = [], otp_app = "metrics", source = "hex", outer_checksum = "69B09ADDDC4F74A40716AE54D140F93BEB0FB8978D8636EADED0C31B6F099F16" },
1616
{ name = "mimerl", version = "1.2.0", build_tools = ["rebar3"], requirements = [], otp_app = "mimerl", source = "hex", outer_checksum = "F278585650AA581986264638EBF698F8BB19DF297F66AD91B18910DFC6E19323" },

src/gleam/http/elli.gleam

+6-14
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import gleam/erlang/atom.{Atom}
22
import gleam/dynamic.{Dynamic}
3-
import gleam/otp/process.{Pid}
4-
import gleam/otp/actor.{StartResult}
5-
import gleam/otp/supervisor
3+
import gleam/erlang/process.{Pid}
64
import gleam/http
75
import gleam/http/service.{Service}
86
import gleam/http/request.{Request}
@@ -13,7 +11,6 @@ import gleam/pair
1311
import gleam/result
1412
import gleam/string
1513
import gleam/bit_builder.{BitBuilder}
16-
import gleam/bit_string
1714

1815
external type ElliRequest
1916

@@ -129,14 +126,13 @@ fn service_to_elli_handler(
129126
pub fn start(
130127
service: Service(BitString, BitBuilder),
131128
on_port number: Int,
132-
) -> StartResult(a) {
129+
) -> Result(Pid, Dynamic) {
133130
[
134131
Port(number),
135132
Callback(atom.create_from_string("gleam_elli_native")),
136133
CallbackArgs(service_to_elli_handler(service)),
137134
]
138135
|> erl_start_link
139-
|> supervisor.from_erlang_start_result
140136
}
141137

142138
/// Start an Elli web server with the current process.
@@ -147,12 +143,8 @@ pub fn start(
147143
pub fn become(
148144
service: Service(BitString, BitBuilder),
149145
on_port number: Int,
150-
) -> Result(Nil, actor.StartError) {
151-
case start(service, number) {
152-
Ok(sender) -> {
153-
let pid = process.pid(sender)
154-
Ok(await_shutdown(pid))
155-
}
156-
Error(e) -> Error(e)
157-
}
146+
) -> Result(Nil, Dynamic) {
147+
service
148+
|> start(number)
149+
|> result.map(await_shutdown)
158150
}

test/gleam/http/elli_test.gleam

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import gleam/erlang
21
import gleam/http/elli
32
import gleam/bit_builder.{BitBuilder}
43
import gleam/http.{Get, Head, Post}

0 commit comments

Comments
 (0)