Initial commit of project
This commit is contained in:
parent
51a5b6c1dc
commit
b0e9a28b4f
12
requirements.txt
Normal file
12
requirements.txt
Normal 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
10
src/api/__init__.py
Normal 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
18
src/api/search.py
Normal 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
14
src/app.py
Executable 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)
|
Reference in New Issue
Block a user