Giter VIP home page Giter VIP logo

roe's Introduction

Build Status Coverage

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.

Install

$ npm i roe

Usage

The usage of roe is much the same as egg, 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.envs.

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

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 except options.plugins

    • plugins since 2.0.0, plugins should be defined in options.config

Creates a roe instance.

License

MIT

roe's People

Contributors

kaelzhang avatar

Watchers

James Cloos avatar  avatar

roe's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.