# nim-cgi **Repository Path**: suconghou/nim-cgi ## Basic Information - **Project Name**: nim-cgi - **Description**: nim lang http server - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-05-31 - **Last Updated**: 2024-05-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### 编译 ```bash nim --mm:orc --threads:off --passC:-flto --passL:-flto -d:release --passL:-s --passL:-static --opt:speed c main ``` ### 编译参数 > -p 指定运行的端口号 > > -w 指定IP白名单 > ### 路由 `POST /block/ip` ```json { "ip": "1.2.3.4", "t": 3600 } ``` t为封禁时间,单位秒,取值 1-2592000,值为1,即解封IP 支持封禁`/24`IP段,当传入的IP是3部分时,自动封禁该IP段,例如`1.2.3`,自动封禁`1.2.3.0/24` 最后一段是0,也是封禁IP段,例如`1.2.3.0`,自动封禁`1.2.3.0/24` 提交的IP必须为IPv4,重复IP将会覆盖时间