aboutsummaryrefslogtreecommitdiff
path: root/captain/api.f90
diff options
context:
space:
mode:
Diffstat (limited to 'captain/api.f90')
-rw-r--r--captain/api.f9036
1 files changed, 33 insertions, 3 deletions
diff --git a/captain/api.f90 b/captain/api.f90
index 48cae8a..8b6890d 100644
--- a/captain/api.f90
+++ b/captain/api.f90
@@ -50,6 +50,7 @@ contains
resp%code = GEMINI_CODE_SUCCESS
call resp%set_body_contents(RESPONSE_JSON_OKAY)
+ resp%body_mimetype = "application/json"
! Checkin - /api/player/{name}/checkin.json
else if(trim(req%component(2)) == "player" .and. trim(req%component(4)) == "checkin.json") then
@@ -76,8 +77,35 @@ contains
use server_response
implicit none
- type(request), intent(in)::req
+ type(titan_request), intent(in)::req
type(response)::resp
+
+ character(len=:), pointer::fullpath
+
+ fullpath => null()
+
+ ! Task - "/api/player/{name}/job/{jobid}/task/{task num}"
+ if(trim(req%component(2)) == "player" .and. &
+ trim(req%component(4)) == "job" .and. &
+ trim(req%component(6)) == "task") then
+
+ fullpath =>
+
+ end if
+
+ if(associated(fullpath)) then
+
+ resp%code = GEMINI_CODE_SUCCESS
+ call resp%set_body_contents(RESPONSE_JSON_OKAY)
+ resp%body_mimetype = "application/json"
+
+ else
+
+ resp%code = GEMINI_CODE_PERMFAIL
+
+ end if
+
+
end function api_request_titan
@@ -85,13 +113,15 @@ contains
use server_response
implicit none
- type(request), intent(in)::req
+ type(request)::req
+ type(titan_request)::titan_req
type(response)::resp
if(req%protocol == "gemini") then
resp = api_request_gemini(req)
else if(req%protocol == "titan") then
- resp = api_request_titan(req)
+ call titan_req%init_from_request(req)
+ resp = api_request_titan(titan_req)
end if
end function api_request