Coder Social home page Coder Social logo

midday / gfe-node-build Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 20 KB

对express+artTemplate+gfe组合的项目进行渲染前处理

Home Page: https://www.npmjs.com/package/gfe-node-build

License: MIT License

JavaScript 82.86% CSS 1.26% HTML 15.88%

gfe-node-build's Introduction

gfe-node-build

如果后端应用框架为 express、前端集成解决方案为 GFE,那么进行 node 本地调试时需要解决下面三个问题:

  • ssi 标签解析(本地调试时页面的ssi标签动态拉取 uat 环境内容)
  • 公共组件 js、css 路径处理(组件前添加uat服务器地址)
  • js 位置的动态处理(本地调试时将 js 脚本位置放到 body 标签之前)

gfe-node-build 恰好解决了以上三个问题

安装

npm install gfe-node-build

使用

var gfeNodeBuild = require('gfe-node-build');
gfeNodeBuild.init(express);

方法

init(express, options)

express Object express 对象

options Object 配置参数对象,如果必要请覆盖相应配置项,默认值如下:

{
    //拉取ssi内容时的域名
    ssiServer: "http://www.atguat.com.cn",

    //拉取js组件时的域名
    jsServer: "http://js.atguat.com.cn",

    //拉取css组件时的域名
    cssServer: "http://css.atguat.com.cn",

    //js插入的位置,取值:insertHead和insertBody
    jsPlace: "insertBody"
}

MIT

gfe-node-build's People

Contributors

midday avatar

Stargazers

wangqing avatar

Watchers

 avatar

Forkers

454665154

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.