vulnapps/apps/vampi/api_views/main.py
Simon Vieille ded6a4f7ab
init
2026-02-11 15:34:31 +01:00

19 lines
791 B
Python

from flask import Response
from models.user_model import *
from app import vuln
def populate_db():
db.drop_all()
db.create_all()
User.init_db_users()
response_text = '{ "message": "Database populated." }'
response = Response(response_text, 200, mimetype='application/json')
return response
def basic():
response_text = '{ "message": "VAmPI the Vulnerable API", "help": "VAmPI is a vulnerable on purpose API. It was ' \
'created in order to evaluate the efficiency of third party tools in identifying vulnerabilities ' \
'in APIs but it can also be used in learning/teaching purposes.", "vulnerable":' + "{}".format(vuln) + "}"
response = Response(response_text, 200, mimetype='application/json')
return response