diff --git a/README.md b/README.md index e3f87ebc..71e90a6a 100644 --- a/README.md +++ b/README.md @@ -131,6 +131,9 @@ REACT_APP_SERVER_URL = "http://localhost:3000" # default. has to be changed if REACT_APP_RAW_SERVER_URL = http://localhost:3003 # default. has to be changed if it is different REACT_APP_STACK_OVERFLOW_API_KEY = "K)aMbXa)izv27xUSCXUW8A((" REACT_APP_STACK_OVERFLOW_API_URL = "https://api.stackexchange.com/2.2/search" +REACT_APP_ELASTIC_HOST = https://search-xxxx-elastic-xxxxxxxxfqsenxxxsm.eu-central-1.es.amazonaws.com # need to be changed +REACT_APP_ELASTIC_PORT = 443 # default. has to be changed if it is different +REACT_APP_ELASTIC_INDEX = search-test # default. has to be changed if it is different ``` _/server/.env_ @@ -167,6 +170,10 @@ SECRET_KEY = secretkey # has to be changed to own random secret key GIT_PATH = '' # Has to be changed to path where you want to save repositories SSH_KEYS = .ssh/authorized_keys # default path to 'authorized_keys' file to store SSH keys in + +ELASTIC_HOST = https://search-xxxx-elastic-xxxxxxxxfqsenxxxsm.eu-central-1.es.amazonaws.com # need to be changed +ELASTIC_PORT = 443 # default. has to be changed if it is different +ELASTIC_INDEX = search-test # default. has to be changed if it is different ``` _/raw-server/.env_ diff --git a/client/.env.example b/client/.env.example index 696ce934..c51b05cd 100644 --- a/client/.env.example +++ b/client/.env.example @@ -16,3 +16,13 @@ REACT_APP_RAW_SERVER_URL = http://localhost:3003 # REACT_APP_STACK_OVERFLOW_API_KEY = "K)aMbXa)izv27xUSCXUW8A((" REACT_APP_STACK_OVERFLOW_API_URL = "https://api.stackexchange.com/2.2/search" + +# +# Elasticsearch +# +#REACT_APP_ELASTIC_HOST - need to be changed +#REACT_APP_ELASTIC_PORT - default. has to be changed if it is different +#REACT_APP_ELASTIC_INDEX - default. has to be changed if it is different +REACT_APP_ELASTIC_HOST = https://search-xxxx-elastic-xxxxxxxxfqsenxxxsm.eu-central-1.es.amazonaws.com +REACT_APP_ELASTIC_PORT = 443 +REACT_APP_ELASTIC_INDEX = search-test \ No newline at end of file diff --git a/client/src/helpers/elasticsearchHelper.js b/client/src/helpers/elasticsearchHelper.js index 1ba1963a..d2427664 100644 --- a/client/src/helpers/elasticsearchHelper.js +++ b/client/src/helpers/elasticsearchHelper.js @@ -5,7 +5,7 @@ const client = new Client({ host: elasticHost, port: elasticPort }); -console.log(index); + export const addUser = async ( username ) => client.index({ index, diff --git a/client/src/scenes/CodeTab/index.jsx b/client/src/scenes/CodeTab/index.jsx index 03abe4e2..44b50935 100644 --- a/client/src/scenes/CodeTab/index.jsx +++ b/client/src/scenes/CodeTab/index.jsx @@ -61,7 +61,7 @@ class CodeTab extends React.Component { } const defaultPath = `/${ownername}/${reponame}/tree/${branch}`; - console.log(defaultPath); + history.push(defaultPath); fetchBranch({ repoID, branch }); diff --git a/server/.env.example b/server/.env.example index 598fe181..268ddea6 100644 --- a/server/.env.example +++ b/server/.env.example @@ -77,3 +77,13 @@ REPO_DATA_QUEUE_NAME = repo-data # Path to 'authorized_keys' file # SSH_KEYS = .ssh/authorized_keys + +# +# Elasticsearch +# +#ELASTIC_HOST - need to be changed +#ELASTIC_PORT - default. has to be changed if it is different +#ELASTIC_INDEX - default. has to be changed if it is different +ELASTIC_HOST = https://search-xxxx-elastic-xxxxxxxxfqsenxxxsm.eu-central-1.es.amazonaws.com +ELASTIC_PORT = 443 +ELASTIC_INDEX = search-test \ No newline at end of file