Initial commit of project

This commit is contained in:
Tyler Perkins 2023-02-23 17:53:11 -05:00
parent 51a5b6c1dc
commit b0e9a28b4f
4 changed files with 54 additions and 0 deletions

12
requirements.txt Normal file
View File

@ -0,0 +1,12 @@
aniso8601==9.0.1
attrs==22.2.0
click==8.1.3
Flask==2.2.3
flask-restx==1.0.6
itsdangerous==2.1.2
Jinja2==3.1.2
jsonschema==4.17.3
MarkupSafe==2.1.2
pyrsistent==0.19.3
pytz==2022.7.1
Werkzeug==2.2.3

10
src/api/__init__.py Normal file
View File

@ -0,0 +1,10 @@
from flask_restx import Api
from .search import api as searchNamespace
api = Api(
title='Search',
version=1.0,
description='Searching the collection'
)
api.add_namespace(searchNamespace)

18
src/api/search.py Normal file
View File

@ -0,0 +1,18 @@
from flask_restx import Namespace, Resource, fields
api = Namespace('search', description='Searching for memes')
query = api.model('Query', {
'query': fields.String(required=True, description='Search string', example='doge'),
})
@api.route('/exact')
@api.doc(params={
'query': 'Name of the meme you are looking for'
})
class exactSearch(Resource):
@api.doc('search')
def get(self):
return {"message" : "hello world!"}

14
src/app.py Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/python
# Entry point
from flask import Flask
from api import api
import os
isDebug = True
app = Flask(__name__)
api.init_app(app)
app.run(debug=isDebug)