[κ°λ°νκ²½]
- Docker Container (mysql + nginx + php)
- Codeigniter 4
- Mac OS
π ν μ΄λΈ μμ± μΏΌλ¦¬λ¬Έ
- νλ‘μ νΈ root ν΄λμ codeignaiter.zip μμΆ νκΈ°
- νλ‘μ νΈ root ν΄λμ phpdocker.zip μμΆ νκΈ°
$ cd /phpdocker/php-fpm/php-ini-override.ini
$ nano php-ini-override.ini
- ini νμΌμ μ€μ μΆκ°νκΈ°
date.timezone = Asia/Seoul
short_open_tag = On
- νλ‘μ νΈ root ν΄λμμ docker compose μ€ννμ¬ μ»¨ν μ΄λ μμ±
$ docker-compose up -d
μμ΄λλ‘ λ¨μΌνμ μμΈ μ 보 μ‘°ν
-
Method:
GET
|POST
-
Params
Required:
id=[Integer]
Optional:
-
Success Response:
{ "status": "success", "user": { "id": "3", "name": "μμμ", "nickname": "mihee", "password": "$2y$10$TM8oYiQHoXF3Zbrab346ZO3pKkhzmBWLqd6NBmBILOUzxHvbCBMT.", "tel": "01022341234", "email": "[email protected]", "gender": "F", "creationtime": "2020-04-23 21:26:03" } }
-
Error Response:
{ "status": "error", "messages": "Undefined index: id" }
OR
{ "status": "error", "messages": "Not Found" }
μ¬λ¬ νμ λͺ©λ‘ μ 보 μ‘°ν
-
Method
GET
|POST
-
Params
Required:Optional:
name=[Stinrg]
email=[String]
limit=[Integer]
//κΈ°λ³Έκ° 1000
offset=[Integer]
//κΈ°λ³Έκ° 0 -
Success Response:
{ "status": "success", "users": [ { "id": "1", "name": "mihee", "nickname": "mihee", "password": "$2y$10$Wur5AddUJHWj8eghSz2dyu8LXHudFicNdrUC50B/4xwU573jO/hoK", "tel": "01022341234", "email": "[email protected]", "gender": "M", "creationtime": "2020-04-23 21:09:23" }, { "id": "2", "name": "μμμ", "nickname": "mihee", "password": "$2y$10$yKkR9658dnK6iFvjeybX6eNlG2OIaCe414/Lr1JlGOdHCtaozn98G", "tel": "01022341234", "email": "[email protected]", "gender": "F", "creationtime": "2020-04-23 21:11:33" } ] } ```
-
Error Response:
{ "status": "error", "messages": "Not Found" }
μ κ· νμμ 보 μμ±νκΈ°
-
Method:
GET
|POST
-
Params
Required:
name=[String]
//μ΅λ κΈΈμ΄ 20μ, νκΈ, μλ¬Έ λμλ¬Έμ
nickname=[String]
//μ΅λ κΈΈμ΄ 30μ, μλ¬Έ μλ¬Έμ
password=[String]
//μ΅μ κΈΈμ΄ 10μ, μλ¬Έ λλ¬Έμ, μλ¬Έ μλ¬Έμ, νΉμλ¬Έμ, μ«μ κ° 1κ° μ΄μμ© ν¬ν¨
email=[String]
//μ΅λ κΈΈμ΄ 100μ
tel=[Integer]
//μ΅λ κΈΈμ΄ 20μOptional:
gender=[String]
//μ΅λ κΈΈμ΄ 1μ, βFβ or βMβ κ°μΈμλ λΉκ°μ²λ¦¬ -
Success Response:
{ "status": "success", "messages": "create new user. id: 6" }
-
Error Response:
{ "status": "error", "messages": "invalid request" }
OR
{ "status": "error", "messages": { "name": "The name field is not in the correct format.", "nickname": "The nickname field is not in the correct format.", "password": "The password field is not in the correct format.", "email": "The email field must contain a unique value.", "tel": "The tel field must only contain digits and must be greater than zero.", "gender": "The gender field is not in the correct format." } }
νμ λ‘κ·ΈμΈ(μΈμ¦)
-
Method:
GET
|POST
-
Params
Required:
email=[String]
password=[String]
Optional:
-
Success Response:
{ "status": "success", "accessToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJtaWhlZSIsInN1YiI6IjUiLCJpYXQiOjE1ODc3MTUzMTEsImV4cCI6MTU4NzcxODkxMX0.8lvtDRrHpazSGH6UWdM0NeVHz9xSrwNZnqeYsItLeJU", "tokenType": "Bearer", "expireTime": 1587718911 }
-
Error Response:
{ "status": "error", "messages": "Not Found" }
νμ λ‘κ·Έμμ
-
Method:
GET
|POST
-
Header
Authorization=μ κ·Ό ν ν°(access token)μ μ λ¬νλ ν€λ
μμ² ν€λ μ
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJtaWhlZSIsInN1YiI6IjMiLCJpYXQiOjE1ODc2NzcxNjgsImV4cCI6MTU4NzY4MDc2OH0.v1t5tkYVdQ2XMN2fpM-xCSyzcr0pw0r0CSGJ4jIdo0M
-
Success Response:
{ "status": "success", "message": "logout" }
-
Error Response:
{ "status": "error", "messages": "Authentication failed" }
accesstoken κ°±μ
-
Method:
GET
|POST
-
Header
Authorization=μ κ·Ό ν ν°(access token)μ μ λ¬νλ ν€λ
μμ² ν€λ μ
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJtaWhlZSIsInN1YiI6IjMiLCJpYXQiOjE1ODc2NzcxNjgsImV4cCI6MTU4NzY4MDc2OH0.v1t5tkYVdQ2XMN2fpM-xCSyzcr0pw0r0CSGJ4jIdo0M
-
Success Response:
{ "status": "success", "accessToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJtaWhlZSIsInN1YiI6IjUiLCJpYXQiOjE1ODc3MTA2ODksImV4cCI6MTU4NzcxNDI4OX0.OJ6mn-kbWDDY4NAQMWAzXvC-Fut3gCOQXQowZYWg5MM", "tokenType": "Bearer", "expireTime": 1587714289 }
-
Error Response:
{ "status": "error", "messages": "Authentication failed" }
postman μ΄μ© postman collection json