-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathintro.py
More file actions
89 lines (79 loc) · 3.17 KB
/
intro.py
File metadata and controls
89 lines (79 loc) · 3.17 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
from flask import Flask
from flask_cors import CORS
from flask_restx import Api, Resource
app = Flask(__name__)
CORS(app, resources={r"*": {"origins": "*"}})
api = Api(app, title='PortfolioBio') # Title of the swagger page.
GetIntroData = api.namespace('GetIntroData') # Name of the endpoint
# Using route decorator to declare the expected inputs. In this example, clientname and requrestID of string type are expected as inputs.
@GetIntroData.route('/', methods=['GET'])
class getintrouidata(Resource):
def get(self):
"""Function to get the extracted data"""
try:
result = {
'designation': 'Front End Developer',
'name': 'SriDivya Pulapa',
'description': 'I love to create beautiful and performant products with delightful user experiences.'
} # Call the required function here to get the output to send it as a response for the end point.
except Exception as exe:
raise RuntimeError(exe)
return result, 200 # Returning response with status code
GetSkillsData = api.namespace('GetSkillsData') # Name of the endpoint
# Using route decorator to declare the expected inputs. In this example, clientname and requrestID of string type are expected as inputs.
@GetSkillsData.route('/', methods=['GET'])
class getskillsuidata(Resource):
def get(self):
"""Function to get the extracted data"""
try:
result = {
"ProficientSkillSet": [
{
'key': 'js',
'title': 'Javascript'
},
{
'key': 'react',
'title': 'React JS'
},
{
'key': 'redux',
'title': 'Redux'
},
{
'key': 'html',
'title': 'HTML'
},
{
'key': 'css',
'title': 'CSS'
},
{
'key': 'sass',
'title': 'Sass'
},
],
"skillfulSkillSet": [
{
'key': 'ts',
'title': 'Typescript'
},
{
'key': 'bs',
'title': 'Bootstrap'
},
{
'key': 'python',
'title': 'Python'
},
{
'key': 'docker',
'title': 'Docker'
},
]
} # Call the required function here to get the output to send it as a response for the end point.
except Exception as exe:
raise RuntimeError(exe)
return result, 200 # Returning response with status code
if __name__ == '__main__':
app.run(debug=True, port=5000)