Rapportsystem API - of D03N
Hovedprosjekt FiV Programmering 20-24
Loading...
Searching...
No Matches
test.py
Go to the documentation of this file.
1from flask_restx import Resource
2from flask import jsonify, session
3#imports os
4import os
5current_directory = os.getcwd()
6#imports sys
7import sys
8sys.path.append(os.path.join(current_directory))
9from flask_jwt_extended import jwt_required
10from Common.Requirements import valid_token as vt
11
12#test route for all userstypes
13def 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_route(ns)
Definition test.py:13