router.js
1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/**
* router of sub app api
* @author: 陈轩<xuan.chen@yoho.cn>
* @date: 2016/09/02
*/
'use strict';
const router = require('express').Router(); // eslint-disable-line
const cRoot = './controllers';
var multipart = require('connect-multiparty');
var multipartMiddleware = multipart();
const uploadApi = require(cRoot + '/upload.js');
const hotfix = require(`${cRoot}/hotfix`);
const apple = require(`${cRoot}/apple`);
const rn = require(`${cRoot}/rn`);
const forward = require(`${cRoot}/forward`);
const switchModel = require(`${cRoot}/switch`);
const pwa = require(`${cRoot}/pwa`);
const miniapp = require(`${cRoot}/miniapp`);
// routers
router.post('/api/upload/image', multipartMiddleware, uploadApi.uploadImg);
router.post('/hf/v1', hotfix.v1);
router.post('/rn/v1', rn.v1);
router.get('/.well-known/apple-app-site-association', apple.appSiteAssociation);
router.get('/api/wechat/miniapp.jpg', forward.miniapp);
router.get('/api/switch', switchModel.index);
router.get('/api/wechat/download', forward.download);
router.get('/activity/api/wechat/download', forward.download);
router.get('/sw.js', pwa.sw);
router.get('/manifest.json', pwa.manifest);
router.get('/activity/sw.js', pwa.sw);
router.get('/activity/manifest.json', pwa.manifest);
// 小程序使用的域名验证文件
router.get('/hfxRaNY27L.txt', miniapp.verify);
router.get('/activity/hfxRaNY27L.txt', miniapp.verify);
router.get('/shop/hfxRaNY27L.txt', miniapp.verify);
router.get('/product/hfxRaNY27L.txt', miniapp.verify);
module.exports = router;