# IP-Address-Query IP简易的地址查询服务,使用Node.js开发,使用了Express框架实现 可实现: 1.可以查询公网IP地址 2.支持json格式返回 ### 使用方法: 0.安装node.js环境
1.clone本项目 ``` git clone http://150.158.7.169:3000/Starlight_0208/IP-Address-Query.git ``` 2.切换到项目路径 ``` cd IP-Address-Query ``` 3.用npm安装环境:
``` npm install express ``` 3.运行起来吧! ``` node app.js ``` ### 请求方式: #### 请求连接: ``` http://{主机地址}:1234/api/IP?{请求体} (端口在js文件中可改) ``` #### 请求体类型 |请求体| 值 | 备注 | | ------- | ------- | ------- | | type | json/text | 结果返回形式 | ### 例子: #### json方式: 请求: ``` http://localhost:1234/api/IP?type=json ``` 返回值 ``` {"IP" : "127.0.0.1", "status" : "OK"} ``` #### 文本方式: 请求: ``` http://localhost:1234/api/IP?type=text 或 http://localhost:1234/api/IP ``` 返回值 ``` 127.0.0.1 ``` -------------- ## 版本更新记录: 暂无更新信息