Skip to content

Commit 4e33374

Browse files
author
Josh Ferrerra
committed
allow cors for related products request
1 parent a0123ca commit 4e33374

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

intelligence/anthill/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM ubuntu:16.04
33
RUN apt-get update && apt-get install -y python3 python3-pip \
44
&& apt-get clean
55

6-
RUN pip3 install numpy scipy Flask neo4j-driver==1.1.0
6+
RUN pip3 install numpy scipy Flask flask-cors neo4j-driver==1.1.0
77

88
RUN mkdir -p /anthill
99
ADD . /anthill/

intelligence/anthill/src/router.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
22

33
from flask import Flask, request, jsonify
4+
from flask_cors import cross_origin
45
from managers.Prod_Prod_Manager import Prod_Prod_Manager
56
from util.ES_Client import ES_Client
67
from util.InvalidUsage import InvalidUsage
@@ -40,6 +41,7 @@ def rec_prod_prod(prod_id):
4041
return jsonify(resp)
4142

4243
@APP.route('/public/prod-prod/full/<int:prod_id>', methods=['GET'])
44+
@cross_origin()
4345
def rec_prod_prod_full(prod_id):
4446
"""rec_prod_prod_full
4547
returns a list of full products from elasticsearch

0 commit comments

Comments
 (0)