File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change
1
+ import envoy
1
2
import gleam/erlang/process
2
3
import gleam/int
3
4
import gleam/result
4
- import envoy
5
5
import mist
6
+ import reply/router
6
7
import wisp
7
8
import wisp/wisp_mist
8
- import reply/router
9
9
10
10
pub fn main ( ) {
11
11
wisp . configure_logger ( )
@@ -20,9 +20,9 @@ pub fn main() {
20
20
// Start the web server process
21
21
let assert Ok ( _ ) =
22
22
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
26
26
27
27
// Put the main process to sleep while the web server does its thing
28
28
process . sleep_forever ( )
Original file line number Diff line number Diff line change 1
- import gleam/http/response
2
1
import gleam/http . { Post }
3
2
import gleam/http/request
3
+ import gleam/http/response
4
4
import gleam/result
5
5
import gleam/string
6
6
import wisp . { type Request , type Response }
@@ -19,7 +19,7 @@ pub fn middleware(
19
19
handle_request ( req )
20
20
}
21
21
22
- pub fn default_responses ( handle_request : fn ( ) -> Response ) {
22
+ pub fn default_responses ( handle_request : fn ( ) -> Response ) {
23
23
let response = handle_request ( )
24
24
25
25
response . set_header ( response , "made-with" , "Gleam" )
@@ -35,7 +35,8 @@ pub fn reply(request: Request) {
35
35
fn reply_post_response ( request : Request ) {
36
36
use body <- wisp . require_string_body ( request )
37
37
38
- let content_type = request . get_header ( request , "content-type" )
38
+ let content_type =
39
+ request . get_header ( request , "content-type" )
39
40
|> result . unwrap ( "application/octet-stream" )
40
41
41
42
wisp . ok ( )
You can’t perform that action at this time.
0 commit comments