-
sudo apt-get install docker* -y
-
Configure .env file located at project root directory.
(Only necessary if you want to customize it)
-
sudo docker-compose up -d
\
Make sure you have permission to run
On docker before application starts:
RUN_TEST_BEFORE_APPLICATION=true
in .env file
- run
sudo docker-compose up -d
On ./runtest script (creates container and removes it):
- Install curl
sudo apt-get install curl -y
(Needed to install Crystal)
- Download Crystal (version 1.8.2)
- Run
sudo ./runtest
in root folder.
{
"travel_stops": [1, 2, 3]
}
content-type: "applicaton/json"
{
"id": 1,
"travel_stops": [
1,
2,
3
]
}
content-type: "applicaton/json"
[
{
"id": 1,
"travel_stops": [
1,
2,
3
]
}
]
content-type: "applicaton/json"
GET: /travel_plans?expand=true
[
{
"id": 1,
"travel_stops": [
{
"id": 1,
"name": "Earth (C-137)",
"type": "Planet",
"dimension": "Dimension C-137"
},
{
"id": 2,
"name": "Abadango",
"type": "Cluster",
"dimension": "unknown"
},
{
"id": 3,
"name": "Citadel of Ricks",
"type": "Space station",
"dimension": "unknown"
}
]
}
]
content-type: "applicaton/json"
GET: /travel_plans?optimize=true
[
{
"id": 1,
"travel_stops": [
1,
2,
3
]
}
]
content-type: "applicaton/json"
GET: /travel_plans?optimize=true&expand=true
[
{
"id": 2,
"travel_stops": [
{
"id": 19,
"name": "Gromflom Prime",
"type": "Planet",
"dimension": "Replacement Dimension"
},
{
"id": 9,
"name": "Purge Planet",
"type": "Planet",
"dimension": "Replacement Dimension"
},
{
"id": 2,
"name": "Abadango",
"type": "Cluster",
"dimension": "unknown"
},
{
"id": 11,
"name": "Bepis 9",
"type": "Planet",
"dimension": "unknown"
},
{
"id": 7,
"name": "Immortality Field Resort",
"type": "Resort",
"dimension": "unknown"
}
]
}
]
content-type: "applicaton/json"
{
"id": 2,
"travel_stops": [
2,
7,
19,
9,
11
]
}
content-type: "applicaton/json"
GET: /travel_plans/2?optimize=true
{
"id": 2,
"travel_stops": [
19,
9,
2,
11,
7
]
}
content-type: "applicaton/json"
GET: /travel_plans/1?expanded=true
{
"id": 1,
"travel_stops": [
{
"id": 1,
"name": "Earth (C-137)",
"type": "Planet",
"dimension": "Dimension C-137"
},
{
"id": 2,
"name": "Abadango",
"type": "Cluster",
"dimension": "unknown"
},
{
"id": 3,
"name": "Citadel of Ricks",
"type": "Space station",
"dimension": "unknown"
}
]
}
content-type: "applicaton/json"
GET: /travel_plans/2?optimize=true&expanded=true
{
"id": 2,
"travel_stops": [
{
"id": 19,
"name": "Gromflom Prime",
"type": "Planet",
"dimension": "Replacement Dimension"
},
{
"id": 9,
"name": "Purge Planet",
"type": "Planet",
"dimension": "Replacement Dimension"
},
{
"id": 2,
"name": "Abadango",
"type": "Cluster",
"dimension": "unknown"
},
{
"id": 11,
"name": "Bepis 9",
"type": "Planet",
"dimension": "unknown"
},
{
"id": 7,
"name": "Immortality Field Resort",
"type": "Resort",
"dimension": "unknown"
}
]
}
content-type: "applicaton/json"
{
"travel_stops": [4, 5, 6]
}
content-type: "applicaton/json"
{
"id": 1,
"travel_stops": [
4,
5,
6
]
}
content-type: "applicaton/json"
POST: /travel_plans/1/append
{
"travel_stops": [9, 10, 11]
}
content-type: "applicaton/json"
{
"id": 1,
"travel_stops": [
4,
5,
6,
9,
10,
11
]
}
content-type: "applicaton/json"
{
"url": "https://static.wikia.nocookie.net/rickandmorty/images/f/fc/S2e5_Earth.png/revision/latest"
}
content-type: "applicaton/json"
(Unfortunately we do not have images of all locations)
Do you want to make these requests? \
Download Postman and import the file multiverse-travels-booker.postman_collection.json
to use the collection with all endpoints.