coffeescript 搭建http服务示例代码

代码语言:coffeescript

所属分类:文件

代码描述:coffeescript 搭建http服务示例代码

代码标签: 服务 示例

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

http = require 'http'

# known mime types
[any, json, xml] = ['*/*', 'application/json', 'text/xml']

# gets a value from the db in format [value, contentType]
get = (store, key, format) ->
    value = store[key]
    throw 'Unknown key' if not value
    switch format
.........完整代码请登录后点击上方下载按钮下载查看

网友评论0