v2ex-api-bridge
Intro
V2EX API Bridge
: 提供论坛公开API的封装和私有API的挖掘实现,目前已支持 登录,签到,发帖,回帖,财富,消息
等非官方API功能.
[Demo:] (https://http://indexxuan.jsonce.com:7001/api/v2/login?username=indexxuantest2&password=justtest)
目前在线demo只开放登录和签到功能,且开启GET方式请求,demo服务器不会收集你的账号密码,但相信你不会尝试的...(微笑)
see
app/router.js
to find full router config & demo api linksThanks for:
- [official API] (https://www.v2ex.com/p/7v9TEc53)
- [V2EX-API] (https://github.com/djyde/V2EX-API)
Development
- require Node.js 7.6.0+ (async & await)
- recommend
yarn install
- recommend nvm - the Node.js Version Manager
$ npm install
$ npm run dev
Features
- ✔︎ Full RESTful Style APIs Wrapped
- ✔︎ 40+ Case, 100%+ Unit Test(
BDD
) - ✔︎ Server Hot Reload in Dev
- ✔︎ pre-commit hook to run codecov & build jsdoc, host in Github Pages @see
package.json#pre-commit
- ✔︎ CI Support
Unit Test
mocha
,thunk-mocha
,power-assert
,istanbul
is build-in toegg-bin
, so you can just use it.power-assert
is very powerful, No API is the best API.- see egg unit test docs for more detail.
npm scripts
- Use
npm start
to run server in prod mode - Use
npm run dev
to dev - Use
npm run lint
to run eslint(eslint not native support es@next now, so...) - Use
npm test
to run unit test - Use
npm run cov
to run code coverage
Todo
- make
pwa
using the APIs - parse the
response html
to get more private APIs - improve
docs
Links
- [V2EX] (https://www.v2ex.com/)
- [egg] (https://github.com/eggjs/egg)
- [egg-bin] (https://github.com/eggjs/egg-bin)
- [mocha] (http://mochajs.org)
- [thunk-mocha] (https://npmjs.com/thunk-mocha)
- [power-assert] (https://github.com/power-assert-js/power-assert)
- [istanbul] (https://github.com/gotwarlost/istanbul)
- [circleci] (https://circleci.com/)
- [codecov] (https://codecov.io/)
- [jsdoc] (https://github.com/jsdoc3/jsdoc)