微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

epii-server 具有以下特性: 基于 koa 的 node 应用框架

程序名称:epii-server 具有以下特性:

授权协议: MIT

操作系统: 跨平台

开发语言: JavaScript

epii-server 具有以下特性: 介绍

epii-server是基于koa的node应用框架,服务与构建渲染工具分离,提供更纯粹的MVC开发体验。

具有以下特性:

MVC 管道

(Request)
  => Middleware => Controller => View =>
(Response)

**ASP.net-liked**

不同的ActionResult会产生不同的响应

// controller
module.exports = [
  {
    path: '/',
    verb: 'get',
    body: async function () {
      // response text/plain
      return this.epii.text('text output')
      // response application/json
      return this.epii.json({ state: true })
      // response text/html by VieWrender
      return this.epii.view({ name: 'Li Lei' })
      // response application/octet-stream
      return this.epii.file('dataset.csv')
    }
  }
]

支持自定义布局

// client/index.Meta.js
module.exports = {
  base: 'simple', // inherit simple layout
  head: {
    styles: 'client/index.css'
  },
  body: {
    holder: 'client/index.html',
    scripts: 'client/index.js'
  }
}
// layout/simple.Meta.js
module.exports = {
  head: {
    title: 'EPII Avatar',
    Metas: [],
    styles: 'reset.css',
    favico: 'epii-icon.png'
  },
  body: {
    scripts: 'jquery-2.2.2.min.js'
  }
}

epii-server 具有以下特性: 官网

https://github.com/epii-io/epii-node-server

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐