You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
76 lines
2.9 KiB
76 lines
2.9 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Web;
|
|
|
|
namespace Apewer.Web
|
|
{
|
|
|
|
/// <summary>选项。</summary>
|
|
public static class ApiOptions
|
|
{
|
|
|
|
#if DEBUG
|
|
private static bool _allowexception = true;
|
|
private static bool _jsonindent = true;
|
|
#else
|
|
private static bool _allowexception = false;
|
|
private static bool _jsonindent = false;
|
|
#endif
|
|
|
|
private static bool _allowfavicon = false;
|
|
private static bool _allowrobot = false;
|
|
private static bool _allowenumerate = true;
|
|
private static bool _showmodule = false;
|
|
private static bool _showclass = false;
|
|
private static int _port = 80;
|
|
|
|
/// <summary>
|
|
/// <para>允许 Invoker 解析 favicon.ico 请求。</para>
|
|
/// <para>默认值:不允许,响应空。</para></summary>
|
|
public static bool AllowFavIcon { get { return _allowfavicon; } set { _allowfavicon = value; } }
|
|
|
|
/// <summary>
|
|
/// <para>允许 Invoker 解析 robot.txt 请求。</para>
|
|
/// <para>默认值:不允许,拒绝搜索引擎收录根目录。</para>
|
|
/// </summary>
|
|
public static bool AllowRobot { get { return _allowrobot; } set { _allowrobot = value; } }
|
|
|
|
/// <summary>
|
|
/// <para>允许 Invoker 枚举输出 Applications 或 Functions。</para>
|
|
/// <para>默认值:允许,输出列表。</para>
|
|
/// </summary>
|
|
public static bool AllowNumerate { get { return _allowenumerate; } set { _allowenumerate = value; } }
|
|
|
|
/// <summary>
|
|
/// <para>允许 Invoker 输出 Exception。</para>
|
|
/// <para>默认值:允许,输出 Exception 对象的属性。</para>
|
|
/// </summary>
|
|
public static bool AllowException { get { return _allowexception; } set { _allowexception = value; } }
|
|
|
|
/// <summary>
|
|
/// <para>允许 Invoker 输出的 Json 对象缩进。</para>
|
|
/// <para>默认值:不允许,不缩进。</para>
|
|
/// </summary>
|
|
public static bool JsonIndent { get { return _jsonindent; } set { _jsonindent = value; } }
|
|
|
|
/// <summary>
|
|
/// <para>允许 Invoker 输出 Application 列表时包含模块信息。</para>
|
|
/// <para>默认值:不允许。</para>
|
|
/// </summary>
|
|
public static bool ShowModule { get { return _showmodule; } set { _showmodule = value; } }
|
|
|
|
/// <summary>
|
|
/// <para>允许 Invoker 输出 Application 列表时包含类型信息。</para>
|
|
/// <para>默认值:不允许。</para>
|
|
/// </summary>
|
|
public static bool ShowClass { get { return _showclass; } set { _showclass = value; } }
|
|
|
|
/// <summary>
|
|
/// <para>获取或设置站点的端口,范围为 0 ~ 65535。</para>
|
|
/// <para>默认值:80。</para>
|
|
/// </summary>
|
|
public static int Port { get { return _port; } set { _port = value < 0 ? 0 : (value > 65535 ? 65535 : value); } }
|
|
|
|
}
|
|
|
|
}
|
|
|