123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238 |
- {
- /* asp.net core ԭʼweb�������� */
- "server": {
- "urls": [ "http://localhost:4513" ]
- },
- "Logging": {
- "LogLevel": {
- "Default": "Warning"
- }
- },
- "AllowedHosts": "*",
- "Sers": {
- /* ͨѶ������ */
- "CL": {
- /* one conn is one channel.can be multiable */
- "Client": [
- {
- // Socket.Iocp
- /* (x.1) type - Iocp */
- /* the class of builder in assemblyFile */
- "className": "Sers.CL.Socket.Iocp.OrganizeClientBuilder",
- /* (x.2) conn config */
- /* ����� host��ַ�����磺 "127.0.0.1"��"sers.com" */
- "host": "127.0.0.1",
- /* ����� �����˿ںš����磺 4501 */
- "port": 4501,
- /* ������Կ��������֤���Ӱ�ȫ�ԡ�����˺Ϳͻ��˱���һ�� */
- "secretKey": "SersCL"
- }
- ]
- },
- /* LocalApiService ����,�ɲ�ָ�� */
- "LocalApiService": {
- /* ��̨������̸߳�������λ����Ĭ��0,������������ */
- "workThreadCount": 4,
- /* ��ʱʱ�䣬���ָ�����̨����������ʱ���������رճ�����ʱ�������,ʵ������ǿ�ƹرյ�ʱ�����1����ʱʱ�䵽2����ʱʱ����)����λ��ms��*/
- //"timeout_ms": 10000,
- /* �Ƿ� �������Api�ĵ�����Ϣ����ApiTrace��Log�ļ���Ĭ��:false */
- "PrintTrace": false,
- /* ��̬�ļ�ӳ������ӳ��վ�㾲̬�ļ����ɶ��,�ɲ�ָ�� */
- "//staticFiles": [
- {
- /* api·��ǰ������ "/demo/ui/*" */
- "route": "/demo/ui/*",
- /* api��������̬�ļ����� */
- "apiName": "demoվ�㾲̬�ļ�",
- /* ��̬�ļ�·������Ϊ���·�������·������Ϊ�ջ���ַ�����Ĭ��Ϊ��ڳ�������Ŀ¼��demo:"wwwroot/demo" */
- "rootPath": "wwwroot/demo",
- /* ��̬�ļ�����ӳ�����õ��ļ�·������Ϊ���·�������·��������"contentTypeMap.json"�����ָ������ָ�����ļ������ڣ���ָ���ļ�����ӳ������ */
- "contentTypeMapFile": "contentTypeMap.json",
- /* ��Ӧ��̬�ļ�ʱ������ӵ�http��Ӧͷ���ɲ�ָ���� */
- "responseHeaders": {
- //�����������̬�ļ�����3600��
- "Cache-Control": "public,max-age=3600"
- }
- }
- ],
- /* Ĭ��վ�����ƣ��ɶ��,�ɲ�ָ�� */
- //"apiStationNames": [ "demo" ],
- /* Api���������� */
- "//ApiLoaders": [
- {
- /* �ڴ�Assembly�в���api������(�� Sers.Core.dll ��Sers.NetcoreLoader.dll �� Sers.Serslot.dll ) */
- //"loader_assemblyFile": "Sers.Core.dll",
- /* ����������������Ϊ Sers.SersLoader.ApiLoader �� Sers.NetcoreLoader.ApiLoader�� Sers.Serslot.ApiLoader �ȡ����ָ����Ĭ��Ϊ"Sers.SersLoader.ApiLoader" */
- //"loader_className": "Sers.SersLoader.ApiLoader",
- //��ͨ������Ӵ˰��л�ȡҪ���ص�api��
- /* �ڴ�Assembly�в��ҷ���(�� Did.SersLoader.Demo.dll)(assembly��assemblyFile��assemblyName ָ����һ����) */
- "assemblyFile": "Did.SersLoader.Demo.dll",
- /* �ڴ�Assembly�в��ҷ���(�� Did.SersLoader.Demo)(assembly��assemblyFile��assemblyName ָ����һ����) */
- //"assemblyName": "Did.SersLoader.Demo",
- /* ǿ��ָ��ApiStation���ơ��ɲ�ָ���������ȼ��Ӹߵ��ͣ� apiStationName_Force �� �ڴ����ϵ�SsStationNameAttribute����ָ�� �� apiStationName �� appsettings.jsonָ���� */
- //"apiStationName_Force": "",
- /* ApiStation���ơ��ɲ�ָ���������ȼ��Ӹߵ��ͣ� apiStationName_Force �� �ڴ����ϵ�SsStationNameAttribute����ָ�� �� apiStationName �� appsettings.jsonָ���� */
- "apiStationName": "demo"
- /* ǿ��·��ǰ,���磺"demo/v1"���ɲ�ָ���������ȼ��Ӹߵ��ͣ� routePrefix_Force���ڴ����ϵ�SsRoutePrefixAttribute����ָ�� �� routePrefix�� */
- //"routePrefix_Force": "",
- /* ·��ǰ,���磺"demo/v1"���ɲ�ָ���������ȼ��Ӹߵ��ͣ� routePrefix_Force���ڴ����ϵ�SsRoutePrefixAttribute����ָ�� �� routePrefix �� */
- //"routePrefix": ""
- }
- ],
- /* ����Apiʱ���Զ���Scope���ɲ�ָ�����¼�˳��Ϊ OnCreateScope -> BeforeCallApi -> OnDispose */
- "//OnCreateScope": [
- {
- /* �ڴ�Assembly�м����� */
- "assemblyFile": "Sers.ApiTrace.dll",
- /* ��̬���ص�����������̳нӿ� Sers.Core.Module.Api.ApiEvent.ApiScope.IApiScope */
- "className": "Sers.ApiTrace.ApiScope"
- }
- ],
- /* ����apiǰ���¼����ɲ�ָ�����¼�˳��Ϊ OnCreateScope -> BeforeCallApi -> OnDispose */
- "//BeforeCallApi": [
- {
- /* �ڴ�Assembly�м����� */
- //"assemblyFile": "Sers.Core.dll",
- /* ��̬���ص�����������̳нӿ� Sers.Core.Module.Api.ApiEvent.BeforeCallApi.IBeforeCallApi */
- "className": "Bearer",
- //Bearer: �ڵ��ýӿ�ǰ�����ȡ rpcData.http.headers.Authorization(��ʽΪ "Bearer xxxxxx")������Ϊ�������ýӿ�api_verifyAt���ѷ������ݷŵ� rpcData.user.userInfo
- /* ��֤at�ӿڵĵ�ַ */
- "api_verifyAt": "/AuthCenter/account/verifyAt",
- /* ��֤at�ӿڵ�httpMethod��(�� GET POST �ɲ�ָ��) */
- "api_httpMethod": "POST"
- },
- {
- //AccountInCookie �ڵ��ýӿ�ǰ�����ȡ rpcData.http.headers.Cookie(��ʽΪ "user=xxx;c=7")�е�user�����˺��б��бȶ�userToken����д CallerSource(rpcData.caller.source) �� userInfo(rpcData.user.userInfo)
- "className": "AccountInCookie",
- "account": [
- {
- "userToken": "admin_123456",
- //"CallerSource": "Internal",
- "userInfo": {
- "name": "��������Ա",
- "���": "Gover����"
- }
- }
- ]
- }
- ]
- },
- /* ServiceStation����,�ɲ�ָ�� */
- "ServiceStation": {
- /* �Զ��ϱ�cpu Usage����ָ�����ϱ� */
- "//UsageReporter": {
- /* �ϱ�ʱ�������λ���룩 */
- "intervalSecond": 2
- },
- /* ��������ע�����á������������ע��վ��ǰ �Ƿ��ӡ��Logger.Info�����������Ĭ��:false */
- "StationRegist_PrintRegistArg": false,
- /* serviceStationվ����Ϣ */
- "serviceStationInfo": {
- "serviceStationName": "SerslotDemo",
- /* ����վ��汾��Ϣ,���ָ����Ϊ������ӿ�İ汾�� */
- //"stationVersion": "1.1.9.0",
- /* [json]����վ�������Ϣ,�ɲ�ָ�� */
- "info": null
- }
- }
- },
- /* Vit�������ã��ɲ�ָ�� */
- "Vit": {
- /* ��־����,�ɲ�ָ�� */
- "Logger": {
- /* print the log to console. default:false */
- "PrintToConsole": true
- },
- /* ���л����ã��ɲ�ָ�� */
- "Serialization": {
- /* ���л��ַ����롣�ɲ�ָ����Ĭ�� UTF8��ֻ��Ϊ UTF7,UTF8,UTF32,ASCII,Unicode�� */
- "Encoding": "UTF8",
- /* ʱ�����л���ʽ���ɲ�ָ����Ĭ�� "yyyy-MM-dd HH:mm:ss" */
- "DateTimeFormat": "yyyy-MM-dd HH:mm:ss"
- }
- },
- "serslot": {
- /* ����api��SsApiDesc��ʽ������ϵͳapi�⣬����ָ������api����ָ���������ݣ�reply��,��ֱ�ӷ������ݣ����ָ���������ݣ�����host���д��� */
- "//extApi": [
- { //Ϊ SsApiDesc��ʽ
- "description": "��ҳ",
- //·��(��Ϊ���ӿ�,�� "/a/*" )
- "route": "/index.html",
- //��չ���ã�json��
- "extendConfig": {
- //����ʽ�����ָ����Ĭ��֧�����з�ʽ��demo: POST��GET��DELETE��PUT�ȣ�
- "httpMethod": "GET",
- //�������ݣ���Ϊ��ֵ���ַ������������飩�����ָ��������host���д���
- "reply": { "hello": "sers" },
- //ϵͳ���ɵĽӿ���������
- "sysDesc": "method:GET"
- }
- },
- {
- //·��(��Ϊ���ӿ�,�� "/a/*" )
- "route": "/*"
- }
- ]
- }
- }
|