V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
The Go Programming Language
http://golang.org/
Go Playground
Go Projects
Revel Web Framework
fansekey
V2EX  ›  Go 编程语言

Martini 和 FIS 的结合

  •  
  •   fansekey · 2014-04-29 18:27:43 +08:00 · 1656 次点击
    这是一个创建于 3649 天前的主题,其中的信息可能已经有所发展或是发生改变。
    FIS: https://github.com/fex-team/fis 前端解决方案
    Martini: http://martini.codegangsta.io Golang的一个开发框架

    Golang已经越来越被人们认可了,也除了不少框架,比如beego,比如Martini。我比较喜欢Martini框架带来的开发方式;简单明了,不累赘。

    FIS前端集成解决方案,解决了诸多前端问题,比如压缩、静态资源链接加时间戳(md5)、合并静态资源、本地路径和线上路径的分离、提供组件化的封装等等等,见官网。

    最近在学习Golang,顺便做了个middleware来结合Martini和FIS。
    Demo: https://github.com/xiangshouding/martini-fis-app
    middleware: https://github.com/xiangshouding/martini-middleware


    如果感兴趣,可以下载demo运行之;

    关于demo的一些说明:

    + 想url加上md5戳(跟时间戳一样的效果) $ gofis release -md remote //加m参数
    + 想合并所有的静态资源
    在demo src的fis-conf.js里面添加一行配置:

    fis.config.set('pack', {
    "static/aio.js": "**.js", //合并所有的js
    "static/aio.css": "**.css" //合并所有的css
    });
    1 条回复    2014-04-29 18:49:29 +08:00
    fansekey
        1
    fansekey  
    OP
       2014-04-29 18:49:29 +08:00
    + 合并 $ gois release -pd remote //加p参数

    上面应该是gois 不是gofis,居然编辑不了,汗~
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1263 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 18:08 · PVG 02:08 · LAX 11:08 · JFK 14:08
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.