Rapportsystem API
- of D03N
Hovedprosjekt FiV Programmering 20-24
Loading...
Searching...
No Matches
test.py
Go to the documentation of this file.
1
from
flask_restx
import
Resource
2
from
flask
import
jsonify, session
3
#imports os
4
import
os
5
current_directory = os.getcwd()
6
#imports sys
7
import
sys
8
sys.path.append(os.path.join(current_directory))
9
from
flask_jwt_extended
import
jwt_required
10
from
Common.Requirements
import
valid_token
as
vt
11
12
#test route for all userstypes
13
def
test_route
(ns):
14
@ns.route('/userStatus')
15
class
Test(Resource):
16
@ns.doc
(
'userStatus'
,
17
description=
'Test route, returns OK if the API is running and the user is logged in.'
,
18
responses={200:
'OK'
,
19
400:
'Invalid Argument'
,
20
500:
'Mapping Key Error'
})
21
22
#Requires valid jwt token
23
@jwt_required()
24
@vt.require_valid_token
25
26
def
get(self):
27
return
jsonify({
"Status"
:
"OK"
})
test.test_route
test_route(ns)
Definition
test.py:13
rapportsystem-backend
Requests
GET_R
test.py
Generated by
1.10.0