GithubHelp home page GithubHelp logo

talkingdata / flclover Goto Github PK

View Code? Open in Web Editor NEW
2.0 8.0 0.0 189 KB

Build better enterprise frameworks and apps with Node.js & Koa2

Home Page: http://flcloverjs.org/

License: MIT License

JavaScript 98.79% Makefile 0.25% Shell 0.96%
flclover koa koa2 node

flclover's Introduction

Flclover

Four leaf clover🍀

NPM version npm download node version Test coverage

Build better enterprise frameworks and apps with Node.js & Koa2

Hello, Flclover!

  • app/router.js
module.exports = (router, controller) => {
  router.get('/', controller.home.index);
};
  • app/controller/home.js
exports.index = async (ctx) => {
  ctx.body = 'Hello, Flclover!';
};

target

  • Coverage 100%
  • Simple, stable and extensible enterprise Node Web framework.

Installation

  • macOS,Linux,Windows
  • Koa requires node v7.6.0 or higher for ES2015 and async function support.

Quick start:

$ npm i flclover-init -g
$ flclover-init flclover-example --type=simple
$ cd flclover-example
$ npm i

Run:

$ npm run dev
$ open localhost:7001

Running tests

$ npm test

Community

License

MIT

flclover's People

Contributors

wxnet2013 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flclover's Issues

Validate middleware

Code show:

exports.index = async (ctx) => {
  ctx.validate({
    page: { format: /\d+/, required: false },
    tab: { type: 'enum', values: [ 'ask', 'share', 'job', 'good' ], required: false },
    limit: { format: /\d+/, required: false },
  }, this.query);

  ctx.body = await this.service.topics.list({});
};

建议增加 editorconfig 文件

root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

Schedule middleware

module.exports = (app) => {
  return {
    schedule: {
      interval: '1s',
      immediate: true,
    },
    async task() {
      // do something
    },
  };
};

0.7.4

Changes

  1. Docs improve
  2. Coverage 100%

Examples

  1. add Proxy

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.