Skip to content

Instantly share code, notes, and snippets.

@holmeszyx
Last active July 11, 2016 01:36
Show Gist options
  • Select an option

  • Save holmeszyx/4ef7a0935e9f7eeadbf8ad6d93508aef to your computer and use it in GitHub Desktop.

Select an option

Save holmeszyx/4ef7a0935e9f7eeadbf8ad6d93508aef to your computer and use it in GitHub Desktop.
简单的config接口

后台一个接口。 比如:yue.fm/api/config 请求: GET yue.fm/api/config?key={key} 返回: 文本 TEXT

后台界面,可以配置。 列出已有的key-value对。就是个列表。

可以添加。一对。 添加界面,就是一个输入key的文本框,一个输入value的文本框。

key是单行,可做一些限制,比如中间没空格什么的。 value是多行。内容任意。

如: key输入channel value输入

{
    android{
    dexOptions {
        incremental true
        javaMaxHeapSize "4g"
    }
    
    productFlavors {
    "1000"{}
    "1001"{}
    "1012"{}
    }
}

保存后。

访问 yue.fm/api/config?key=channel,就直接返回原始输入的key对应的value字符。

{
    android{
    dexOptions {
        incremental true
        javaMaxHeapSize "4g"
    }
    
    productFlavors {
    "1000"{}
    "1001"{}
    "1012"{}
    }
}

原始东西是什么,就输入什么。

数据库都可以不用,直接以key为文件名,value为文件内容都行。

https://vscode-update.azurewebsites.net/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment