appsettings.json 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. {
  2. /* asp.net core ԭʼweb�������� */
  3. "server": {
  4. "urls": [ "http://localhost:4513" ]
  5. },
  6. "Logging": {
  7. "LogLevel": {
  8. "Default": "Warning"
  9. }
  10. },
  11. "AllowedHosts": "*",
  12. "Sers": {
  13. /* ͨѶ������ */
  14. "CL": {
  15. /* one conn is one channel.can be multiable */
  16. "Client": [
  17. {
  18. // Socket.Iocp
  19. /* (x.1) type - Iocp */
  20. /* the class of builder in assemblyFile */
  21. "className": "Sers.CL.Socket.Iocp.OrganizeClientBuilder",
  22. /* (x.2) conn config */
  23. /* ����� host��ַ�����磺 "127.0.0.1"��"sers.com" */
  24. "host": "127.0.0.1",
  25. /* ����� �����˿ںš����磺 4501 */
  26. "port": 4501,
  27. /* ������Կ��������֤���Ӱ�ȫ�ԡ�����˺Ϳͻ��˱���һ�� */
  28. "secretKey": "SersCL"
  29. }
  30. ]
  31. },
  32. /* LocalApiService ����,�ɲ�ָ�� */
  33. "LocalApiService": {
  34. /* ��̨������̸߳�������λ����Ĭ��0,������������ */
  35. "workThreadCount": 4,
  36. /* ��ʱʱ�䣬���ָ�����̨����������ʱ���������رճ�����ʱ�������,ʵ������ǿ�ƹرյ�ʱ�����1����ʱʱ�䵽2����ʱʱ����)����λ��ms��*/
  37. //"timeout_ms": 10000,
  38. /* �Ƿ� �������Api�ĵ�����Ϣ����ApiTrace��Log�ļ���Ĭ��:false */
  39. "PrintTrace": false,
  40. /* ��̬�ļ�ӳ������ӳ��վ�㾲̬�ļ����ɶ��,�ɲ�ָ�� */
  41. "//staticFiles": [
  42. {
  43. /* api·��ǰ׺������ "/demo/ui/*" */
  44. "route": "/demo/ui/*",
  45. /* api��������̬�ļ����� */
  46. "apiName": "demoվ�㾲̬�ļ�",
  47. /* ��̬�ļ�·������Ϊ���·�������·������Ϊ�ջ���ַ�����Ĭ��Ϊ��ڳ�������Ŀ¼��demo:"wwwroot/demo" */
  48. "rootPath": "wwwroot/demo",
  49. /* ��̬�ļ�����ӳ�����õ��ļ�·������Ϊ���·�������·��������"contentTypeMap.json"�����ָ������ָ�����ļ������ڣ���ָ���ļ�����ӳ������ */
  50. "contentTypeMapFile": "contentTypeMap.json",
  51. /* ��Ӧ��̬�ļ�ʱ������ӵ�http��Ӧͷ���ɲ�ָ���� */
  52. "responseHeaders": {
  53. //�����������̬�ļ�����3600��
  54. "Cache-Control": "public,max-age=3600"
  55. }
  56. }
  57. ],
  58. /* Ĭ��վ�����ƣ��ɶ��,�ɲ�ָ�� */
  59. //"apiStationNames": [ "demo" ],
  60. /* Api���������� */
  61. "//ApiLoaders": [
  62. {
  63. /* �ڴ�Assembly�в���api������(�� Sers.Core.dll ��Sers.NetcoreLoader.dll �� Sers.Serslot.dll ) */
  64. //"loader_assemblyFile": "Sers.Core.dll",
  65. /* ����������������Ϊ Sers.SersLoader.ApiLoader �� Sers.NetcoreLoader.ApiLoader�� Sers.Serslot.ApiLoader �ȡ����ָ����Ĭ��Ϊ"Sers.SersLoader.ApiLoader" */
  66. //"loader_className": "Sers.SersLoader.ApiLoader",
  67. //��ͨ������Ӵ˰��л�ȡҪ���ص�api��
  68. /* �ڴ�Assembly�в��ҷ���(�� Did.SersLoader.Demo.dll)(assembly��assemblyFile��assemblyName ָ����һ����) */
  69. "assemblyFile": "Did.SersLoader.Demo.dll",
  70. /* �ڴ�Assembly�в��ҷ���(�� Did.SersLoader.Demo)(assembly��assemblyFile��assemblyName ָ����һ����) */
  71. //"assemblyName": "Did.SersLoader.Demo",
  72. /* ǿ��ָ��ApiStation���ơ��ɲ�ָ���������ȼ��Ӹߵ��ͣ� apiStationName_Force �� �ڴ����ϵ�SsStationNameAttribute����ָ�� �� apiStationName �� appsettings.jsonָ���� */
  73. //"apiStationName_Force": "",
  74. /* ApiStation���ơ��ɲ�ָ���������ȼ��Ӹߵ��ͣ� apiStationName_Force �� �ڴ����ϵ�SsStationNameAttribute����ָ�� �� apiStationName �� appsettings.jsonָ���� */
  75. "apiStationName": "demo"
  76. /* ǿ��·��ǰ׺,���磺"demo/v1"���ɲ�ָ���������ȼ��Ӹߵ��ͣ� routePrefix_Force���ڴ����ϵ�SsRoutePrefixAttribute����ָ�� �� routePrefix�� */
  77. //"routePrefix_Force": "",
  78. /* ·��ǰ׺,���磺"demo/v1"���ɲ�ָ���������ȼ��Ӹߵ��ͣ� routePrefix_Force���ڴ����ϵ�SsRoutePrefixAttribute����ָ�� �� routePrefix �� */
  79. //"routePrefix": ""
  80. }
  81. ],
  82. /* ����Apiʱ���Զ���Scope���󡣿ɲ�ָ�����¼�˳��Ϊ OnCreateScope -> BeforeCallApi -> OnDispose */
  83. "//OnCreateScope": [
  84. {
  85. /* �ڴ�Assembly�м����� */
  86. "assemblyFile": "Sers.ApiTrace.dll",
  87. /* ��̬���ص�����������̳нӿ� Sers.Core.Module.Api.ApiEvent.ApiScope.IApiScope */
  88. "className": "Sers.ApiTrace.ApiScope"
  89. }
  90. ],
  91. /* ����apiǰ���¼����ɲ�ָ�����¼�˳��Ϊ OnCreateScope -> BeforeCallApi -> OnDispose */
  92. "//BeforeCallApi": [
  93. {
  94. /* �ڴ�Assembly�м����� */
  95. //"assemblyFile": "Sers.Core.dll",
  96. /* ��̬���ص�����������̳нӿ� Sers.Core.Module.Api.ApiEvent.BeforeCallApi.IBeforeCallApi */
  97. "className": "Bearer",
  98. //Bearer: �ڵ��ýӿ�ǰ�����ȡ rpcData.http.headers.Authorization(��ʽΪ "Bearer xxxxxx")������Ϊ�������ýӿ�api_verifyAt���ѷ������ݷŵ� rpcData.user.userInfo
  99. /* ��֤at�ӿڵĵ�ַ */
  100. "api_verifyAt": "/AuthCenter/account/verifyAt",
  101. /* ��֤at�ӿڵ�httpMethod��(�� GET POST �ɲ�ָ��) */
  102. "api_httpMethod": "POST"
  103. },
  104. {
  105. //AccountInCookie �ڵ��ýӿ�ǰ�����ȡ rpcData.http.headers.Cookie(��ʽΪ "user=xxx;c=7")�е�user�����˺��б��бȶ�userToken����д CallerSource(rpcData.caller.source) �� userInfo(rpcData.user.userInfo)
  106. "className": "AccountInCookie",
  107. "account": [
  108. {
  109. "userToken": "admin_123456",
  110. //"CallerSource": "Internal",
  111. "userInfo": {
  112. "name": "��������Ա",
  113. "���": "Gover����"
  114. }
  115. }
  116. ]
  117. }
  118. ]
  119. },
  120. /* ServiceStation����,�ɲ�ָ�� */
  121. "ServiceStation": {
  122. /* �Զ��ϱ�cpu Usage����ָ�����ϱ� */
  123. "//UsageReporter": {
  124. /* �ϱ�ʱ�������λ���룩 */
  125. "intervalSecond": 2
  126. },
  127. /* ��������ע�����á������������ע��վ��ǰ �Ƿ��ӡ��Logger.Info�����������Ĭ��:false */
  128. "StationRegist_PrintRegistArg": false,
  129. /* serviceStationվ����Ϣ */
  130. "serviceStationInfo": {
  131. "serviceStationName": "SerslotDemo",
  132. /* ����վ��汾��Ϣ,���ָ����Ϊ������ӿ�İ汾�� */
  133. //"stationVersion": "1.1.9.0",
  134. /* [json]����վ�������Ϣ,�ɲ�ָ�� */
  135. "info": null
  136. }
  137. }
  138. },
  139. /* Vit�������ã��ɲ�ָ�� */
  140. "Vit": {
  141. /* ��־����,�ɲ�ָ�� */
  142. "Logger": {
  143. /* print the log to console. default:false */
  144. "PrintToConsole": true
  145. },
  146. /* ���л����ã��ɲ�ָ�� */
  147. "Serialization": {
  148. /* ���л��ַ����롣�ɲ�ָ����Ĭ�� UTF8��ֻ��Ϊ UTF7,UTF8,UTF32,ASCII,Unicode�� */
  149. "Encoding": "UTF8",
  150. /* ʱ�����л���ʽ���ɲ�ָ����Ĭ�� "yyyy-MM-dd HH:mm:ss" */
  151. "DateTimeFormat": "yyyy-MM-dd HH:mm:ss"
  152. }
  153. },
  154. "serslot": {
  155. /* ����api��SsApiDesc��ʽ������ϵͳapi�⣬����ָ������api����ָ���������ݣ�reply��,��ֱ�ӷ������ݣ����ָ���������ݣ�����host���д��� */
  156. "//extApi": [
  157. { //Ϊ SsApiDesc��ʽ
  158. "description": "��ҳ",
  159. //·��(��Ϊ���ӿ�,�� "/a/*" )
  160. "route": "/index.html",
  161. //��չ���ã�json��
  162. "extendConfig": {
  163. //����ʽ�����ָ����Ĭ��֧�����з�ʽ��demo: POST��GET��DELETE��PUT�ȣ�
  164. "httpMethod": "GET",
  165. //�������ݣ���Ϊ��ֵ���ַ������������飩�����ָ��������host���д���
  166. "reply": { "hello": "sers" },
  167. //ϵͳ���ɵĽӿ���������
  168. "sysDesc": "method:GET"
  169. }
  170. },
  171. {
  172. //·��(��Ϊ���ӿ�,�� "/a/*" )
  173. "route": "/*"
  174. }
  175. ]
  176. }
  177. }