tiny-express

0.1.0 • Public • Published

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>
}

Readme

Keywords

Package Sidebar

Install

npm i tiny-express

Weekly Downloads

15

Version

0.1.0

License

MIT

Last publish

Collaborators

  • kenberkeley