# roe

> A single and simplified instance of Egg web framework without clusters and agents, which is more suitable for container-based deployment, such as Docker and Kubernetes

Latest version **2.1.2** (published 2019-07-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install roe
pnpm add roe
yarn add roe
bun add roe
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.2 |
| Published | 2019-07-01 |
| First published | 2017-04-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 6 |
| Dependencies | 4 |
| Unpacked size | 9.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | kaelzhang |
| Maintainers | kael |
| Keywords | roe, egg, web, app, application, http, framework, middleware, koa |

## Links

- npm: https://www.npmjs.com/package/roe
- Repository: https://github.com/kaelzhang/roe
- Homepage: https://github.com/kaelzhang/roe#readme
- Issues: https://github.com/kaelzhang/roe/issues
- npm.io page: https://npm.io/package/roe

## Dependencies (4)

- [extend2](https://npm.io/package/extend2.md) ^1.0.0
- [egg-core](https://npm.io/package/egg-core.md) ^4.17.2
- [err-object](https://npm.io/package/err-object.md) ^5.1.2
- [core-util-is](https://npm.io/package/core-util-is.md) ^1.0.2

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 2.1.2 (latest) — 2019-07-01
- 2.1.1 — 2019-05-28
- 2.1.0 — 2019-05-28
- 2.0.0 — 2019-04-15
- 1.2.0 — 2019-04-14
- 1.1.3 — 2019-04-12
- 1.1.2 — 2019-03-27
- 1.1.1 — 2019-03-27
- 1.1.0 — 2019-03-23
- 0.0.0 — 2017-04-26

## README

[![Build Status](https://travis-ci.org/kaelzhang/roe.svg?branch=master)](https://travis-ci.org/kaelzhang/roe)
[![Coverage](https://codecov.io/gh/kaelzhang/roe/branch/master/graph/badge.svg)](https://codecov.io/gh/kaelzhang/roe)
<!-- optional appveyor tst
[![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/kaelzhang/roe?branch=master&svg=true)](https://ci.appveyor.com/project/kaelzhang/roe)
-->
<!-- optional npm version
[![NPM version](https://badge.fury.io/js/roe.svg)](http://badge.fury.io/js/roe)
-->
<!-- optional npm downloads
[![npm module downloads per month](http://img.shields.io/npm/dm/roe.svg)](https://www.npmjs.org/package/roe)
-->
<!-- optional dependency status
[![Dependency Status](https://david-dm.org/kaelzhang/roe.svg)](https://david-dm.org/kaelzhang/roe)
-->

# roe

A single and simplified instance of [Egg](https://eggjs.org/) web framework without clusters and agents, which is more suitable for container-based deployment, such as Docker and Kubernetes.

## Install

```sh
$ npm i roe
```

## Usage

The usage of `roe` is much the same as [`egg`](https://eggjs.org), and you can dive into the reference of egg directly.

In addition, `roe` constructor accepts `options.config` as the server configuration, instead of by hardcoding all configurations of different environments in the local project which is an ANTI-PATTERN for ops.

A better practice is to use Kubernetes configmaps and secrets to populate them into `process.env`s.

```js
const {Roe} = require('roe')

const app = new Roe({
  baseDir: '/path/to',

  // We can define roe configurations directly
  //   by passing options.config, which is a good practise
  //   for k8s based environment variables management
  config: {
    keys: process.env.SECRET_KEY,
    middleware: [
      'body-parser'
    ]
  }
})

app.ready(() => {
  app.listen(8888)
})
```

Or starting with vanilla nodejs http server

```js
require('http')
.createServer(app.callback())
.listen(8888)
```

## new Roe(options)

- **options** `Object`
  - **config** `Object | Function(appInfo)` similar as `config/config.default.js` of egg
  - **extends** `Object` which will be `Object.assign()` into the instance before loaders are invoked.
  - **...others** `Object` other options of [`EggCore`](https://npmjs.org/package/egg-core) except `options.plugins`

  - ~~**plugins**~~ since 2.0.0, `plugins` should be defined in `options.config`

Creates a roe instance.

## License

MIT

---
_Source: https://npm.io/package/roe · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
