Skip to content

Commit 08cff68

Browse files
committed
format
1 parent 78f39c0 commit 08cff68

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/reply.gleam

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
import envoy
12
import gleam/erlang/process
23
import gleam/int
34
import gleam/result
4-
import envoy
55
import mist
6+
import reply/router
67
import wisp
78
import wisp/wisp_mist
8-
import reply/router
99

1010
pub fn main() {
1111
wisp.configure_logger()
@@ -20,9 +20,9 @@ pub fn main() {
2020
// Start the web server process
2121
let assert Ok(_) =
2222
wisp_mist.handler(router.handle_request, secret_key_base)
23-
|> mist.new
24-
|> mist.port(port)
25-
|> mist.start_http
23+
|> mist.new
24+
|> mist.port(port)
25+
|> mist.start_http
2626

2727
// Put the main process to sleep while the web server does its thing
2828
process.sleep_forever()

src/reply/web.gleam

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import gleam/http/response
21
import gleam/http.{Post}
32
import gleam/http/request
3+
import gleam/http/response
44
import gleam/result
55
import gleam/string
66
import wisp.{type Request, type Response}
@@ -19,7 +19,7 @@ pub fn middleware(
1919
handle_request(req)
2020
}
2121

22-
pub fn default_responses(handle_request: fn() -> Response){
22+
pub fn default_responses(handle_request: fn() -> Response) {
2323
let response = handle_request()
2424

2525
response.set_header(response, "made-with", "Gleam")
@@ -35,7 +35,8 @@ pub fn reply(request: Request) {
3535
fn reply_post_response(request: Request) {
3636
use body <- wisp.require_string_body(request)
3737

38-
let content_type = request.get_header(request, "content-type")
38+
let content_type =
39+
request.get_header(request, "content-type")
3940
|> result.unwrap("application/octet-stream")
4041

4142
wisp.ok()

0 commit comments

Comments
 (0)