Skip to content
An example project showing how to use Elasticsearch with React
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Updates for React 16, bump version number, save JS with prettier Oct 15, 2017
.gitignore
LICENSE Initial commit Jan 27, 2016
README.md Update README with prereqs, run steps, and thanks! Jan 27, 2016
index.html
package.json
webpack.config.js

README.md

elasticsearch-react-example

An example project showing how to use Elasticsearch with React

Prerequisites

To run this example, you will need to configure Elasticsearch to accept requests from the browser using CORS. To enable CORS, add the following to Elasticsearch's config file. Usually, this file is located near the elasticsearch executable at config/elasticsearch.yml. source

http.cors:
  enabled: true
  allow-origin: /https?:\/\/localhost(:[0-9]+)?/

To run the example:

  1. Clone this repo locally (or just download and unzip it)
git clone https://github.com/scotchfield/elasticsearch-react-example.git
  1. Move into the project
cd elasticsearch-react-example
  1. Run npm install
npm install
  1. Run webpack (or webpack-dev-server) to build the index.js source file.

Thanks

Cheers to the Angular Elasticsearch example for describing how to setup http.cors. Thanks, spalger!

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.