mirror of
https://github.com/Mueller-Patrick/Betterzon.git
synced 2026-05-03 10:30:11 +00:00
BETTERZON-49: Added minimal Flask API as Docker container
This commit is contained in:
@@ -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>
|
||||
+1
-1
@@ -17,4 +17,4 @@ EXPOSE 22026
|
||||
|
||||
# Start API
|
||||
RUN echo 'Starting API'
|
||||
CMD ["python3", "main.py"]
|
||||
CMD ["python3", "api.py"]
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user