GithubHelp home page GithubHelp logo

git-patrickliu / html-engine Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mice530/html-engine

0.0 2.0 0.0 469 KB

An html middleware between browser and web-backend.

License: MIT License

JavaScript 98.84% HTML 1.16%

html-engine's Introduction

html-engine

An html middleware between browser and web-backend.

use cnpm install @froad/html-hengine to install html-engine.

We have build a company npm in our company with @froad as a prefix. So @froad/* is a private npm package hosted in our own npm server. Use npm config set registry http://10.43.1.203:11504 to access our own npm server.

Design Docs

see design docs;

Usage

上面设计文档当中大致讲了html-engine的设计思路,这一节我们就专门讲html-engine的使用方法。

  1. html-engine支持的路由种类:

    1. /template, 获取目录下的template文件,以text/html的content-type返回,供用户调用。

    templateSequence

    1. 以html结尾,也将返回对应的纯html文件(未经任何处理)。

    htmlSequence

    1. 正常请求,将同时去后台拉取json数据,和模板进行合并。

    normalSequence

    1. 正常请求,如果query当中带有nodata=1, 则省去向后台请求,而是在get参数作为替代后台data。

    nodataSequence

  2. 如果url形式和1中路由不符合,可以如test/index.js中所示,在koa中先使用一个中间件来保证传入path的正确性。

html-engine's People

Contributors

git-patrickliu avatar

Watchers

 avatar  avatar

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.