All Projects → doodooke → Doodoo.js

doodooke / Doodoo.js

Licence: mit
Doodoo.js -- 中文最佳实践Node.js Web快速开发框架,支持Koa.js, Express.js中间件。

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Doodoo.js

koahub-cli
KoaHub CLI -- KoaHub.js的开发工具,自动babel编译 ES6/7(Generator Function, Class, Async & Await)并且文件修改后自动重启。
Stars: ✭ 16 (-71.93%)
Mutual labels:  koa, koajs
polix
🚀 Node.js Web Framework
Stars: ✭ 32 (-43.86%)
Mutual labels:  koa, koajs
koa
A golang framework like koa.js and has the best performance with net/http.
Stars: ✭ 30 (-47.37%)
Mutual labels:  koa, koajs
Koach Javascript
Production ready Koa2 boilerplate.
Stars: ✭ 79 (+38.6%)
Mutual labels:  koa, koajs
Koahub Demo
koahub+async/await+mysql
Stars: ✭ 15 (-73.68%)
Mutual labels:  koa, koajs
koa-subdomain
Simple and lightweight Koa middleware to handle multilevel and wildcard subdomains
Stars: ✭ 23 (-59.65%)
Mutual labels:  koa, koajs
restria
Entria's REST API boilerplate
Stars: ✭ 25 (-56.14%)
Mutual labels:  koa, koajs
Cool Admin Api
cool-admin-api 是基于egg.js、typeorm、jwt等封装的api开发脚手架、快速开发api接口
Stars: ✭ 188 (+229.82%)
Mutual labels:  koa, koajs
Koa2 Note
《Koa2进阶学习笔记》已完结🎄🎄🎄
Stars: ✭ 4,725 (+8189.47%)
Mutual labels:  koa, koajs
Koa Template
Starter template for Nuxt.js with KoaJS.
Stars: ✭ 374 (+556.14%)
Mutual labels:  koa, koajs
koa-server
🗄️ GraphQL Back-end Server with Relay, Koa, MongoDB and Mongoose
Stars: ✭ 31 (-45.61%)
Mutual labels:  koa, koajs
Vue Chat
👥Vue全家桶+Socket.io+Express/Koa2打造一个智能聊天室。
Stars: ✭ 887 (+1456.14%)
Mutual labels:  koa, koajs
Koahub
KoaHub.js -- 中文最佳实践Node.js Web快速开发框架。支持Koa.js, Express.js中间件。当前项目已停止维护,推荐使用Doodoo.js
Stars: ✭ 308 (+440.35%)
Mutual labels:  koa, koajs
Koajs Design Note
《Koa.js 设计模式-学习笔记》已完结 😆
Stars: ✭ 520 (+812.28%)
Mutual labels:  koa, koajs
Koa Typeorm Starter
Starter project for using koa with TS and TypeORM
Stars: ✭ 23 (-59.65%)
Mutual labels:  koa, koajs
Timeline Vue
💌基于 Vue -> Koa2 -> Mongoose 的留言时间轴,记录美好时光。
Stars: ✭ 14 (-75.44%)
Mutual labels:  koa
Dito
Dito.js is a declarative and modern web framework with a focus on API driven development, based on Objection.js, Koa.js and Vue.js – Released in 2018 under the MIT license, with support by Lineto.com
Stars: ✭ 44 (-22.81%)
Mutual labels:  koa
Koa Vue Notes Project
🤓 A single repo containing both the koa-vue-notes-api and koa-vue-notes-web projects.
Stars: ✭ 14 (-75.44%)
Mutual labels:  koa
Koa Sass
koa wrapper for sass-middleware
Stars: ✭ 13 (-77.19%)
Mutual labels:  koa
Koa Vue Ssr Template
This template built with vue 2.x, vue-router & vuex & webpack3 with server-side rendering by koa
Stars: ✭ 53 (-7.02%)
Mutual labels:  koa

Doodoo.js

license travis-ci codecov Dependency Status

Doodoo.js -- 中文最佳实践Node.js Web快速开发框架,支持Koa.js, Express.js中间件。

//base controller, app/demo/controller/base.js
module.exports = class extends doodoo.Controller {

    async _initialize() {
        console.log('base _initialize');
    }

    async isLogin() {
        console.log('base isLogin');
    }
}

//index controller, app/demo/controller/index.js
const base = require('./base');
module.exports = class extends base {

    async _initialize() {
        await super._initialize();
    }

    async index() {
        this.success("Hello Doodoo.js");
    }

    async index2() {
        this.fail("Hello Doodoo.js");
    }
}

环境要求:Node.js >= 8.0.0

特性

  • 支持koa全部中间件
  • 支持使用 ES6+ 全部特性来开发项目
  • 支持断点调试 ES6+ 项目
  • 支持多种项目结构和多种项目环境
  • 支持 Route, Controller 中使用Koa.js的所有API
  • 支持多级 Controller
  • 支持模块化开发
  • 支持钩子机制
  • 支持插件机制
  • 支持错误处理
  • 支持全局 doodoo 变量
  • 支持 mysql, mongodb 数据库
  • 支持前置,后置操作
  • 支持 Restful 设计
  • 支持启动自定义
  • 支持环境加载配置
  • ...

安装

yarn add doodoo.js

创建启动文件

// app/index.js启动文件
const Doodoo = require('doodoo.js');

// 初始化项目
const app = new Doodoo();

// 启动项目
app.start();

方法

ctx上的函数或参数将自动加载到controller,例如支持 this.body = 'Hello World!', ctx中具体的API请参考Koa.js, controller中的扩展方法如下。

this.ctx;
this.next;
this.isGet();
this.isPost();
this.isAjax();
this.isPjax();
this.isMethod(method);
this.hook.run(name, ...args);
this.download(file);
this.view(data);
this.success(errmsg: "ok", errcode: 0, data: data);
this.error(errmsg = "error", errcode = 1);

配置

# 应用配置
app:
  root: app
  port: 3000
  host: "127.0.0.1"
  prefix: ""

# 静态资源服务
static:
  dir: www
  maxAge: 30 * 24 * 60 * 60
  dynamic: true

其他

// 控制器初始化,前置,后置,空操作
async _initialize()
async _before()
async _before_index()
async index()
async _after_index()
async _after()

开始应用

// 下载demo
git clone https://github.com/doodooke/doodoo.js.git
// 安装依赖
yarn install
// 进入项目
cd doodoo.js/example
// 启动项目
node app.js

启动信息

[doodoo] Version: 2.0.0
[doodoo] Website: 127.0.0.1
[doodoo] Nodejs Version: v8.12.0
[doodoo] Nodejs Platform: darwin x64
[doodoo] Server Enviroment: development
[doodoo] Server Startup Time: 212ms
[doodoo] Server Current Time: 2018-08-21 11:17:19
[doodoo] Server Running At: http://127.0.0.1:3000

使用手册

Doodoo.js使用手册

问题反馈

在使用中有任何问题,请使用以下联系方式联系我们

QQ群: 874449168(交流群①)

EMAIL: [email protected]

Github: https://github.com/doodooke/doodoo.js

官网

多多客Doodooke小程序

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].