/canvas-server

字符头像生成

Primary LanguageJavaScriptMIT LicenseMIT

canvas-server

字符头像生成,背后不是 node-canvas 驱动,canvas很美好,可我没法解决中文问题,最后是 gm 在驱动图形处理。

Usage

如何运行?

node ./server.js

API开放接口

// GET 请求方式
http://character-image.plusman.cn/CharacterImage/:character

// 参数说明
:character 单字符,传参数时对参数做一层,encodeURIComponent 编码。

// 示例
http://character-image.plusman.cn/CharacterImage/%E4%B8%9C

// return JSON
{
  "code": 0,
  "message": "success",
  "data": {
    "hash": "from_cached",
    "key": "东.png",
    "url": "http://7xk6mk.com1.z0.glb.clouddn.com/%E4%B8%9C.png"
  }
}

效果图
会 友 行 G

License

(The MIT License)

Copyright (c) 2015 plusmancn

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.