Routes Mapping API

Mapping an App and a Route

POST /v2/route_mappings

Request

Route

POST /v2/route_mappings

Body

Name Description Default Valid Values Example Values
app_guid The guid of the bound application.
  • guid-9b46b715-5a34-42fb-9d4f-f4d2c763ae5a
route_guid The guid of the bound route.
  • guid-3e598d8e-5414-4ed0-99c2-0c87d25ce6cc
app_port Port on which the application should listen, and to which requests for the mapped route will be routed. Must be among those already configured for the app. If a port is not specified when mapping the route, the first one in the list of those configured for the app will be chosen.
{
  "app_guid": "fa23ddfc-b635-4205-8283-844c53122888",
  "route_guid": "e00fb1e1-f7d4-4e36-9912-f76a587e9858",
  "app_port": 8888
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQyOCIsImVtYWlsIjoiZW1haWwtMjkwQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjYwMDg5MDJ9.FW51EL1bd_qko7cWDjCNANoZyX2Qy8zMuKP1-GZu4s4
Host: example.org
Content-Type: application/json
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/route_mappings" -d '{
  "app_guid": "fa23ddfc-b635-4205-8283-844c53122888",
  "route_guid": "e00fb1e1-f7d4-4e36-9912-f76a587e9858",
  "app_port": 8888
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQyOCIsImVtYWlsIjoiZW1haWwtMjkwQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjYwMDg5MDJ9.FW51EL1bd_qko7cWDjCNANoZyX2Qy8zMuKP1-GZu4s4" \
	-H "Host: example.org" \
	-H "Content-Type: application/json" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "f869fa46-22b1-40ee-b491-58e321345528",
    "url": "/v2/route_mappings/f869fa46-22b1-40ee-b491-58e321345528",
    "created_at": "2016-06-08T16:41:42Z",
    "updated_at": "2016-06-08T16:41:26Z"
  },
  "entity": {
    "app_port": 8888,
    "app_guid": "fa23ddfc-b635-4205-8283-844c53122888",
    "route_guid": "e00fb1e1-f7d4-4e36-9912-f76a587e9858",
    "app_url": "/v2/apps/fa23ddfc-b635-4205-8283-844c53122888",
    "route_url": "/v2/routes/e00fb1e1-f7d4-4e36-9912-f76a587e9858"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/route_mappings/f869fa46-22b1-40ee-b491-58e321345528
X-VCAP-Request-ID: dfdc0d02-549c-434b-9bc7-4513479a2569
Content-Length: 496
X-Content-Type-Options: nosniff