Skip to content

Commit eb1c928

Browse files
committed
ポート番号の修正
1 parent 4104c9e commit eb1c928

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

README.md

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
11
# return-http-status-code
22
API to return HTTP status code
33
## Setup
4+
Clone the repository
45
```
56
$ git clone https://github.com/mitty1293/return-http-status-code.git
7+
```
8+
Write the NGINX port to be accessed in the `return-http-status-code/.env` file.
9+
```
10+
NGINX_PORT=80
11+
```
12+
Start the container
13+
```
614
$ docker-compose -f ./return-http-status-code/docker-compose.yml up -d
715
```
816
## Usage
917
Enter any status code in `[http_status_code]` and access the following URL.
1018
```
11-
http://host-ip:8004/[http_status_code]
19+
http://host-ip:[NGINX_PORT]/[http_status_code]
1220
```
13-
If a status code that is not listed in the `flask/app/const.py` is specified, `404 Not Found` will be returned.
21+
If a status code that is not listed in the [class http.HTTPStatus](https://docs.python.org/3/library/http.html#http-status-codes) is specified, `404 Not Found` will be returned.
1422
### Example
1523
```Shell
16-
$ curl -I http://host-ip:8004/500
24+
$ curl -I http://host-ip:[NGINX_PORT]/500
1725
HTTP/1.1 500 INTERNAL SERVER ERROR
1826
Server: nginx/1.20.1
1927
Date: Tue, 13 Jul 2021 15:16:34 GMT

0 commit comments

Comments
 (0)