1- # Functional HTTP server
1+ < img src = " ./.github/fl-word_art-http_server-reverse.svg " alt = " Functional Core " width = " 450 " />
22
33A simple HTTP server inspired by Express and in tune with Functional Programming principles in JavaScript for Deno.
44
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 )
66[ ![ deno version] ( https://img.shields.io/badge/deno-^1.4.6-lightgrey?logo=deno )] ( https://github.com/denoland/deno )
77[ ![ GitHub release] ( https://img.shields.io/github/v/release/sebastienfilion/functional )] ( https://github.com/sebastienfilion/functional-http-server/releases )
88[ ![ 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
1717function that takes a ` Request ` and return a ` Task ` of a ` Response ` .
1818
1919``` 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" ;
2323
2424startHTTPServer ({ port: 8080 }, request => Task .of (Response .OK ({}, request .raw )));
2525```
@@ -44,10 +44,10 @@ The assertion function takes a `Request` and return a `Boolean`, the handling fu
4444must return a ` Task ` of a ` Response ` .
4545
4646``` 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" ;
5151
5252startHTTPServer (
5353 { port: 8080 },
@@ -66,10 +66,10 @@ Because the pattern is common, this library also offers a collection of handler
6666the assertion function. Each handler takes a ` String ` or a ` RegExp ` and a unary function.
6767
6868``` 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" ;
7373
7474startHTTPServer (
7575 { port: 8080 },
@@ -88,7 +88,7 @@ The binary function handler will be called with an object containing the origina
8888and other parameters; the second argument is the body of request serialized based on the content type.
8989
9090``` 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" ;
9292
9393startHTTPServer (
9494 { port: 8080 },
0 commit comments