0.1.0 • Published 7 years ago

tiny-express v0.1.0

Weekly downloads
8
License
MIT
Repository
github
Last release
7 years ago

Tiny Express

Build Status Coverage Status

Implement a tiny express which can run in browser

Methods supported: GET / POST / PUT / DELETE / PATCH / OPTIONS

app.use(<middleware>)
app.VERB(<path>, <middlewares?>, <handler>)

app
  .receive({ method: <String>, url: <String>, body: <Any> })
  .respond(function(result) {
    // deal with result
  })
req: {
  method: <String>,
  originalUrl: <String>,
  path: <String>,
  query: <Object>,
  params: <Object>,
  body: <Object>
}

res: {
  send: <Function>,
  json: <Function>
}