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-9381257e-6247-4010-b209-3fb17addf47f
|
route_guid
|
The guid of the bound route.
|
|
|
- guid-83eeb8da-104b-48da-8c95-3258b4761104
|
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": "4c4e083f-3638-4a0b-bd3a-ac3c0a680b1b",
"route_guid": "ae4ec3ea-938f-4465-a912-42b27d9e26b4",
"app_port": 8888
}
Headers
cURL
curl "https://api.[your-domain.com]/v2/route_mappings" -d '{
"app_guid": "4c4e083f-3638-4a0b-bd3a-ac3c0a680b1b",
"route_guid": "ae4ec3ea-938f-4465-a912-42b27d9e26b4",
"app_port": 8888
}' -X POST \
-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTEwMiIsImVtYWlsIjoiZW1haWwtNjZAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQ2MTM3NDYyNn0.xIN7dVeduTX2E8h1zKi4bLwfrNPKEyZVsRhMCtqanbY" \
-H "Host: example.org" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Cookie: "
Response
Status
201 Created
Body
{
"metadata": {
"guid": "63b6a10a-68de-475a-87cf-cff82749bf5d",
"url": "/v2/route_mappings/63b6a10a-68de-475a-87cf-cff82749bf5d",
"created_at": "2016-04-16T01:23:46Z",
"updated_at": null
},
"entity": {
"app_port": 8888,
"app_guid": "4c4e083f-3638-4a0b-bd3a-ac3c0a680b1b",
"route_guid": "ae4ec3ea-938f-4465-a912-42b27d9e26b4",
"app_url": "/v2/apps/4c4e083f-3638-4a0b-bd3a-ac3c0a680b1b",
"route_url": "/v2/routes/ae4ec3ea-938f-4465-a912-42b27d9e26b4"
}
}
Headers