Skip to content

tetsuo/hyper-fluture

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hyper-fluture

monadic http middleware based on hyper-ts.

  • uses flutures instead of promises
  • not indexed

install

npm install hyper-fluture

hello world

import * as express from 'express'
import * as H from 'hyper-fluture'
import { toRequestHandler } from 'hyper-fluture/lib/express'
import { pipe } from 'fp-ts/lib/pipeable'

const hello: H.Middleware<never, void> = pipe(
  H.status(H.Status.OK), // writes the response status
  H.chain(() => H.send('Hello hyper-fluture on express!')) // sends the response as text
)

express()
  .get('/', toRequestHandler(hello))
  .listen(3000, () => console.log('Express listening on port 3000. Use: GET /'))

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published