Giter Club home page Giter Club logo

koa_demo's Introduction

koa_demo

这是一个koa 示例,这是参照koa-rudy项目开发的。主要架构和思路参照该项目文档,这里我只是介绍下我增加的部分;

目录

|- resource-util |- |- properties-to-json properties文件转成json格式的几个方法 |- |- static-resource-util 远程拉取properties文件的处理层

resource-util

这是根据之前java项目处理前端静态资源加载的改写的node版本。主要的方式和逻辑跟之前一致 主要思路

  • 根据环境区分本地或者远程环境,本地环境根据本地静态配置读取。
  • test、beta、product环境则每分钟定时拉取远端staticResourceConfig.properties文件,之后每次比较该文件中的staticResourceMD5字段和获取的staticResource.properties文件的md5比较,如果不一致则也更新staticResource.properties文件。否则不操作。

usage[说明]

  • 在主程序中引用 static-resource-util.js中的startLoadProperties() 方法开始加载静态资源配置文件properties
  • 在view层需要获取前端静态资源(js,css)的情况下,引用static-resource-util.js中的getURL方法;

koa_demo's People

Stargazers

aronlee avatar

Watchers

aronlee 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.