forked from bvabhishek/api-security
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlab2.py
More file actions
30 lines (26 loc) · 673 Bytes
/
lab2.py
File metadata and controls
30 lines (26 loc) · 673 Bytes
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
import flask
from flask import request, jsonify
app = flask.Flask(__name__)
app.config["DEBUG"] = True
CreditCards = [
{'id': 0,
'creditCard': '1234567901234',
'user': 'yuvan',
'CVV': '677',
'validUntil': '1992'},
{'id': 1,
'creditCard': '1234567901235',
'user': 'Vittal',
'CVV': '677',
'validUntil': '2022'},
{'id': 2,
'creditCard': '1234567901239',
'user': 'Janesh',
'CVV': '677',
'validUntil': '2023'}
]
# A route to return all of the available entries in our catalog.
@app.route('/api/v1/shop/cc/all', methods=['GET'])
def api_all():
return jsonify(CreditCards)
app.run(host="0.0.0.0",port="5005")