-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME
70 lines (53 loc) · 1.98 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
Create a static react app that contacts a RESTful interface to display
a list of airline flights, allows the user to select one and enter
passenger data, submits that data back to the RESTful interface, and
displays confirmation data. Everything should occur as a page; there
should be no page loads after the first.
This project includes a Python3 file that implements a Pyramid app which
provides a REST interface and a JSON file containing information about
available flights.
When run, the app is served at localhost on port 5000. Instructions for
setting up the development environment and running the Flask app are in
the docstring.
It has these endpoints:
GET /flights - returns JSON in the form:
{
"flights": [
{
"number": "AA1234", "airline": "Awesome Airlines",
"departs": {
"airport": "SFO", "when": "2015-01-01T12:00:00"
}, "arrives": {
"airport": "IAH", "when": "2014-01-01T19:00:00"
}, "cost": 567.89
}, # ...
]
}
POST /book - accepts data:
{
"firstname": "John",
"lastname": "Doe",
"flight_number": "AA1234",
"bags": 2
}
and responds:
{ "success": true, "confirmation": "ZHJ2F8" }
or
{ "success": false, "message": "This flight is full." }
If also has validation to let you know if you passed something wrong:
{
"success": False,
"message": "You did not pass a valid request",
"errors": [
{
"field": "first_name",
"error": "is_required",
}
]
}
Other endpoints are allowed but not required.
All times are in UTC. All costs are in US dollars.
You are responsible for the workflow and design
You will be submitting a Github Repo containing HTML, JS, CSS, and additional
resources (images, etc.). You may (and probably should!) use any third party
components / libraries you are comfortable with.