roo

roo

Jump-start your front-end server

Showing:

Popularity

Downloads/wk

7

GitHub Stars

105

Maintenance

Last Commit

5yrs ago

Contributors

3

Package

Dependencies

6

Size (min+gzip)

205.4KB

License

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Roo

NOTE: 2.x is a significant departure from 0.x. Roo has been updated to reflect the changing landscape. The new roo is only meant to recieve and response to dynamic data.

Jump-start your front-end server. Bundles and configures the boilerplate of a Koa app.

Installation

npm install roo

Features

  • Deployable: Ready to be deployed to Dokku or Heroku
  • Composable: Mount Koa servers within or mount within other Koa servers.

Example

const roo = Roo()
const users = Roo()

roo.mount('/users', users)

users.get('/', function * () {
  this.body = 'users!'
})

roo.listen(3000)

API

Roo()

Initialize Roo.

Roo.{get,post,put,delete,...}(route[, middleware, ...], handle)

Add a route to Roo. Routing is powered by kr, so visit there for API details.

roo.post('/signup', signup)
Roo.use(generator)

Pass additional middleware generator's to Roo.

Roo.mount([path], app)

Mount an app inside of Roo at path. path defaults to /

const app = roo()
const dash = roo()
app.mount('/dashboard', dash);
Roo.listen(port, fn)

Start the server on port. You may pass the environment variable PORT=8080 in to specify a port. Otherwise it defaults to 3000 if otherwise not specified.

Roo.listener()

Get koa's request handler. Useful if you'd like to proxy requests.

Test

npm install
make test

Why Roo?

Roo is short for Kangaroo. I wrote this while visiting Australia for CampJS and I have Kangaroos on my mind.

Credits

Kangaroo Icon by Olivier Guin

License

MIT

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial