mirror of
https://github.com/Mueller-Patrick/Betterzon.git
synced 2025-04-19 07:19:18 +00:00
BETTERZON-49: Added minimal Flask API as Docker container
This commit is contained in:
parent
91a59de073
commit
d4f7c7940d
|
@ -1,8 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="Python" name="Python">
|
||||
<configuration sdkName="Python 3.9 (venv)" />
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="Python 3.9 (venv) interpreter library" level="application" />
|
||||
</component>
|
||||
</module>
|
|
@ -17,4 +17,4 @@ EXPOSE 22026
|
|||
|
||||
# Start API
|
||||
RUN echo 'Starting API'
|
||||
CMD ["python3", "main.py"]
|
||||
CMD ["python3", "api.py"]
|
||||
|
|
16
Crawler/api.py
Normal file
16
Crawler/api.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
from flask import Flask
|
||||
from flask_restful import Resource, Api
|
||||
|
||||
app = Flask(__name__)
|
||||
api = Api(app)
|
||||
|
||||
|
||||
class CrawlerApi(Resource):
|
||||
def get(self):
|
||||
return {'Hallo': 'Betterzon'}
|
||||
|
||||
|
||||
api.add_resource(CrawlerApi, '/')
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(host='0.0.0.0', port=22026)
|
|
@ -1 +1,4 @@
|
|||
pymysql
|
||||
flask
|
||||
flask-sqlalchemy
|
||||
flask_restful
|
Loading…
Reference in New Issue
Block a user