Giter Site home page Giter Site logo

egg-isomorphic's Introduction

egg-isomorphic

基于egg框架的前后端分离(页面直出)实现方案。

快速开始

服务端启动:

$ npm install
$ npm start

前端启动:

$ cd app/public/assets
$ npm install
$ npm build
$ npm start

准备就绪,去浏览器查看:

$ open http://localhost:7001/news

注意: egg 在开发期默认启动 development 插件,修改服务端代码后,会自动重启 worker 进程。

egg使用问题及建议

Please open an issue here.

业界相关实践

  1. 腾讯新闻React同构直出优化实践
  2. React同构实践与思考
  3. React Koa 同构实践
  4. 降低首屏时间,“直出”是个什么概念?
  5. 【AlloyTeam优化系列】Node直出让你的网页秒开
  6. Node直出理论与实践总结
  7. 趣店(原分期)前端团队基于koa.js的前后端分离实践
  8. (番外篇) 同构化的 React + Redux 服务端渲染
  9. React+Redux同构应用开发
  10. 前后端分离与前端工程化

概念说明

概念 描述
Controller 逻辑更加简洁,专注 Web 页面的渲染
Service 负责组装和格式化 Proxy 接口提供的数据,并封装业务逻辑,被多个 Controller 使用
Proxy 从 Service 中细分出的数据层,专门负责跟后端获取数据。

egg插件编写

插件是 egg 的精髓之一,它其实就是一个 mini 应用,用于逻辑解耦,便于生态复用和差异化定制。

优点 描述
共建生态 譬如 egg-security这些插件,沉淀了很多企业级开发的经验,可以在应用中自由选择,一键引入,极大的方便了开发者。
差异化定制 譬如 view 插件,在 egg 里面只是定义了 view 的规范和接口,上层应用可以使用不同的插件, 如 egg-view-nunjucks来实现差异化定制。

egg-isomorphic's People

Contributors

abell123456 avatar carmanchang avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

wenbaofu

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.