forked from Yanshijie-EL/egg-swagger-doc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.default.js
55 lines (53 loc) · 1.61 KB
/
config.default.js
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
47
48
49
50
51
52
53
54
55
'use strict';
/**
* egg-swagger-doc default config
* @member Config#swagger-doc
* @property {String} dirScanner - 插件扫描的文档路径
* @property {String} basePath - api前置路由
* @property {Object} apiInfo - 可参考Swagger文档中的Info
* @property {Array[String]} apiInfo - 可参考Swagger文档中的Info
* @property {Array[String]} schemes - 访问地址协议http或者https
* @property {Array[String]} consumes - contentType的集合
* @property {Array[String]} produces - contentType的集合
* @property {Object} securityDefinitions - 安全验证,具体参考swagger官方文档
* @property {Boolean} enableSecurity - 是否使用安全验证
* @property {Boolean} routeMap - 是否自动生成route
* @property {Boolean} enable - swagger-ui是否可以访问
*/
exports.swaggerdoc = {
dirScanner: './app/controller',
basePath: '/',
apiInfo: {
title: 'egg-swagger',
description: 'swagger-ui for egg js api',
version: '1.0.0',
},
schemes: ['http', 'https'],
consumes: ['application/json'],
produces: ['application/json'],
securityDefinitions: {
// apikey: {
// type: 'apiKey',
// name: 'clientkey',
// in: 'header',
// },
// oauth2: {
// type: 'oauth2',
// tokenUrl: 'http://petstore.swagger.io/oauth/dialog',
// flow: 'password',
// scopes: {
// 'write:access_token': 'write access_token',
// 'read:access_token': 'read access_token',
// },
// },
},
enableSecurity: false,
// enableValidate: true,
routerMap: false,
enable: true,
};
exports.security = {
csrf: {
enable: false,
},
};