# image-server **Repository Path**: makeup1122/image-server ## Basic Information - **Project Name**: image-server - **Description**: 图片处理服务 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2018-08-04 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 后端图片处理服务 # 资料 ## Dependencies * [NodeJs(>7.x)](http://nodejs.cn/api/) * [Koa2](https://koa.bootcss.com/) * [Koa-send](https://github.com/koajs/send) * [Sharp库](https://github.com/lovell/sharp) * [ESlint](https://eslint.org/docs/) ## Tools 1. [supervisor](https://github.com/petruisfan/node-supervisor) # 运行 ``` npm run start ``` 开发 ``` npx run dev ``` # 接口说明 ## 地址 * http://img.opera.sx-cc.com ## 请求参数 * `width` 请求图片宽度,单位px,默认为`null`。 * `height` 请求图片高度,单位px,默认为`null`。 * `nowatermark` 请不带水印叠加的图片,仅当请求原图时有效,默认为`true`,即带水印,可选值:`false` ## 其他 * 尺寸值仅指定`width`或`height`其中之一时,另一个参数为自适应。 * 请求范例 ``` http://img.opera.sx-cc.com/2018/08/04/test.jpg?width=200 http://img.opera.sx-cc.com/2018/08/04/test.jpg?height=200 http://img.opera.sx-cc.com/2018/08/04/test.jpg?width=200&height=200 http://img.opera.sx-cc.com/2018/08/04/test.jpg?nowatermark=true ``` # 问题记录 ## ctx.query.hasOwnProperty is not a function https://github.com/hapijs/hapi/issues/3280 ## 服务部署 ![npm install error](https://images.gitee.com/uploads/images/2018/0806/214435_920b0747_9726.png "屏幕截图.png") npm install --unsafe-perm=true