Home
Version 3
Routes Mapping API

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-f1795754-720e-44f9-ad5d-ed505af4c560
route_guid The guid of the bound route.
  • guid-9bccccd7-d562-4c98-a2db-a991162429c9
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": "3d3d1467-9b68-4eac-9ab5-48106384df18",
  "route_guid": "c4b67801-4b60-4084-b929-eff651dc9569",
  "app_port": 8888
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIxMiIsImVtYWlsIjoiZW1haWwtMTczQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTg1OTk0NDF9.HT9Ty5jvhUZ9aDsSeKH78OOm8NIMYmpLjzzKkNhZT-A
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/route_mappings" -d '{
  "app_guid": "3d3d1467-9b68-4eac-9ab5-48106384df18",
  "route_guid": "c4b67801-4b60-4084-b929-eff651dc9569",
  "app_port": 8888
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIxMiIsImVtYWlsIjoiZW1haWwtMTczQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTg1OTk0NDF9.HT9Ty5jvhUZ9aDsSeKH78OOm8NIMYmpLjzzKkNhZT-A" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "985b7061-6bc4-49a3-9542-99eefeb1819f",
    "url": "/v2/route_mappings/985b7061-6bc4-49a3-9542-99eefeb1819f",
    "created_at": "2016-03-14T22:30:41Z",
    "updated_at": null
  },
  "entity": {
    "app_port": 8888,
    "app_guid": "3d3d1467-9b68-4eac-9ab5-48106384df18",
    "route_guid": "c4b67801-4b60-4084-b929-eff651dc9569",
    "app_url": "/v2/apps/3d3d1467-9b68-4eac-9ab5-48106384df18",
    "route_url": "/v2/routes/c4b67801-4b60-4084-b929-eff651dc9569"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/route_mappings/985b7061-6bc4-49a3-9542-99eefeb1819f
X-VCAP-Request-ID: 
Content-Length: 496
X-Content-Type-Options: nosniff