IP-Address-Query/README.md
2021-06-27 00:35:19 +08:00

68 lines
1.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# IP-Address-Query
IP简易的地址查询服务使用Node.js开发使用了Express框架实现
可实现:
1.可以查询公网IP地址
2.支持json格式返回
### 使用方法:
0.安装node.js环境<br/>
1.clone本项目
```
git clone http://150.158.7.169:3000/Starlight_0208/IP-Address-Query.git
```
2.切换到项目路径
```
cd IP-Address-Query
```
3.用npm安装环境:<br/>
```
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
```
--------------
## 版本更新记录:
暂无更新信息