Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/weivea/koa-ueditor
基于koajs的ueditor
https://github.com/weivea/koa-ueditor
Last synced: about 9 hours ago
JSON representation
基于koajs的ueditor
- Host: GitHub
- URL: https://github.com/weivea/koa-ueditor
- Owner: weivea
- License: isc
- Created: 2016-01-26T08:56:00.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-03-04T12:18:54.000Z (over 8 years ago)
- Last Synced: 2024-11-12T06:38:08.294Z (4 days ago)
- Language: JavaScript
- Size: 2.66 MB
- Stars: 13
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# koa-ueditor
基于koajs的ueditor支持 图片 和 文件的上传
#### 安装
`npm install koa-ueditor --save`#### 使用
ueditor的web端配置请参考[官网](http://ueditor.baidu.com/website/)
将`example/public`下的ueditor文件夹整个拷贝到项目的静态资源文件夹根目录下如`静态资源文件夹/ueditor`
使用样例饿
```
var route = require('koa-router')();
var views = require('co-views');
var serve = require('koa-static');//模板。静态资源
var render = views('views', {
map: { html: 'ejs' }
});var staticsPath = 'public';//静态资源路径
app.use(serve(staticsPath));//设置静态资源路径
var ueditor = require('koa-ueditor')(staticsPath);//配置ueditor
route.all('/ueditor/ue', ueditor);route.get('/', function *(){
this.body = yield render("ueditor");
});
```#### 邮箱