1
- # Functional HTTP server
1
+ < img src = " ./.github/fl-word_art-http_server-reverse.svg " alt = " Functional Core " width = " 450 " />
2
2
3
3
A simple HTTP server inspired by Express and in tune with Functional Programming principles in JavaScript for Deno.
4
4
5
- [ ![ deno land] ( http://img.shields.io/badge/available%20on-deno.land/x-lightgrey.svg?logo=deno&labelColor=black )] ( https://github.com/sebastienfilion/functional-http-server@v0.1.1 )
5
+ [ ![ deno land] ( http://img.shields.io/badge/available%20on-deno.land/x-lightgrey.svg?logo=deno&labelColor=black )] ( https://github.com/sebastienfilion/functional-http-server@v0.3.0 )
6
6
[ ![ deno version] ( https://img.shields.io/badge/deno-^1.4.6-lightgrey?logo=deno )] ( https://github.com/denoland/deno )
7
7
[ ![ GitHub release] ( https://img.shields.io/github/v/release/sebastienfilion/functional )] ( https://github.com/sebastienfilion/functional-http-server/releases )
8
8
[ ![ GitHub licence] ( https://img.shields.io/github/license/sebastienfilion/functional )] ( https://github.com/sebastienfilion/functional-http-server/blob/v0.1.1/LICENSE )
@@ -17,9 +17,9 @@ The function takes two arguments; the first argument is the options, and the sec
17
17
function that takes a ` Request ` and return a ` Task ` of a ` Response ` .
18
18
19
19
``` js
20
- import Task from " https://deno.land/x/functional@v1.1.0 /library/Task.js" ;
21
- import Response from " https://deno.land/x/functional_io@v0.5 .0/library/Response.js" ;
22
- import startHTTPServer from " https://deno.land/x/functional_http_server@v0.1 .0/library/server.js" ;
20
+ import Task from " https://deno.land/x/functional@v1.2.1 /library/Task.js" ;
21
+ import Response from " https://deno.land/x/functional_io@v1.0 .0/library/Response.js" ;
22
+ import startHTTPServer from " https://deno.land/x/functional_http_server@v0.3 .0/library/server.js" ;
23
23
24
24
startHTTPServer ({ port: 8080 }, request => Task .of (Response .OK ({}, request .raw )));
25
25
```
@@ -44,10 +44,10 @@ The assertion function takes a `Request` and return a `Boolean`, the handling fu
44
44
must return a ` Task ` of a ` Response ` .
45
45
46
46
``` js
47
- import Task from " https://deno.land/x/functional@v1.1.0 /library/Task.js" ;
48
- import { encodeText } from " https://deno.land/x/functional@v1.1.0 /library/utilities.js" ;
49
- import Response from " https://deno.land/x/functional_io@v0.5 .0/library/Response.js" ;
50
- import { route } from " https://deno.land/x/functional_http_server@v0.1 .0/library/route.js" ;
47
+ import Task from " https://deno.land/x/functional@v1.2.1 /library/Task.js" ;
48
+ import { encodeText } from " https://deno.land/x/functional@v1.2.1 /library/utilities.js" ;
49
+ import Response from " https://deno.land/x/functional_io@v1.0 .0/library/Response.js" ;
50
+ import { route } from " https://deno.land/x/functional_http_server@v0.3 .0/library/route.js" ;
51
51
52
52
startHTTPServer (
53
53
{ port: 8080 },
@@ -66,10 +66,10 @@ Because the pattern is common, this library also offers a collection of handler
66
66
the assertion function. Each handler takes a ` String ` or a ` RegExp ` and a unary function.
67
67
68
68
``` js
69
- import Task from " https://deno.land/x/functional@v1.1.0 /library/Task.js" ;
70
- import { encodeText } from " https://deno.land/x/functional@v1.1.0 /library/utilities.js" ;
71
- import Response from " https://deno.land/x/functional_io@v0.5 .0/library/Response.js" ;
72
- import { handlers , route } from " https://deno.land/x/functional_http_server@v0.1 .0/library/route.js" ;
69
+ import Task from " https://deno.land/x/functional@v1.2.1 /library/Task.js" ;
70
+ import { encodeText } from " https://deno.land/x/functional@v1.2.1 /library/utilities.js" ;
71
+ import Response from " https://deno.land/x/functional_io@v1.0 .0/library/Response.js" ;
72
+ import { handlers , route } from " https://deno.land/x/functional_http_server@v0.3 .0/library/route.js" ;
73
73
74
74
startHTTPServer (
75
75
{ port: 8080 },
@@ -88,7 +88,7 @@ The binary function handler will be called with an object containing the origina
88
88
and other parameters; the second argument is the body of request serialized based on the content type.
89
89
90
90
``` js
91
- import { explodeRequest } from " https://deno.land/x/functional_http_server@v0.1 .0/library/utilities.js" ;
91
+ import { explodeRequest } from " https://deno.land/x/functional_http_server@v0.3 .0/library/utilities.js" ;
92
92
93
93
startHTTPServer (
94
94
{ port: 8080 },
0 commit comments