自述文件
This commit is contained in:
parent
bd0e90ddb8
commit
d82a11feea
67
README.md
67
README.md
@ -1,3 +1,68 @@
|
||||
# IP-Address-Query
|
||||
|
||||
IP简易的地址查询服务,使用Node.js开发,使用了Express框架实现
|
||||
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
|
||||
```
|
||||
--------------
|
||||
##版本更新记录:
|
||||
暂无更新信息
|
||||
Loading…
x
Reference in New Issue
Block a user