server-handler.js
714 Bytes
const express = require('express');
const multipart = require('connect-multiparty');
const passport = require('../models/passport');
const upload = require('../models/upload');
const app = express();
const router = express.Router(); // eslint-disable-line
const multipartMiddleware = multipart();
router.post('/xianyu/upload/idcard', multipartMiddleware, upload.uploadIdCard);
router.get('/xianyu/passport/login/taobao', passport.login.taobaoLogin);
router.get('/xianyu/passport/callback/taobao', passport.login.taobaoCallback);
router.post('/xianyu/passport/bind/sms/send', passport.bind.sendSms);
router.post('/xianyu/passport/bind/third', passport.bind.bindByCode);
app.use(router);
module.exports = app;