Provide currency microservice (#1)
* Initial release of the currencies microservice
* Added CORS handling
New file |
| | |
| | | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. |
| | | |
| | | # dependencies |
| | | /venv |
| | | __pycache__ |
| | | |
| | | # misc |
| | | .DS_Store |
New file |
| | |
| | | FROM ubi8/python-36 |
| | | |
| | | ENV FLASK_APP="currencies.py" |
| | | |
| | | COPY src /app |
| | | COPY requirements.txt /app |
| | | |
| | | WORKDIR /app |
| | | |
| | | RUN pip install -r requirements.txt |
| | | |
| | | EXPOSE 5000 |
| | | |
| | | CMD [ "flask", "run", "--host=0.0.0.0"] |
New file |
| | |
| | | Flask |
| | | flask-cors |
New file |
| | |
| | | from flask import Flask, jsonify |
| | | from flask_cors import CORS |
| | | |
| | | app = Flask(__name__) |
| | | CORS(app) |
| | | |
| | | @app.route('/') |
| | | def currenciesList(): |
| | | return jsonify('EUR', 'USD') |