Web services for nodebnb
export elasticsearch bin folder, e.g.
$ echo 'export PATH=/Users/ytian/Applications/elasticsearch-1.5.2/bin:$PATH' >> ~/.bash_profile; source ~/.bash_profile
export convenient way to run ES6 Babel on Node.js
$ echo 'alias bodemon="nodemon --exec babel-node -- --stage 1 --optional strict --"' >> ~/.bash_profile
-
Clone the repo:
git clone https://github.com/nodebnb/BackEnd.git
-
Go into folder:
cd BackEnd
-
Install dependencies:
npm install
-
Create local MongoDB database called nodebnb
-
Create ElasticSearch index
curl -XPUT 'http://localhost:9200/listings/'
-
Load history data into MongoDB
mongoimport --db nodebnb --collection listings --file data/bnb.json
Or crawl new data
bodemon bin/scraper.js
-
Index data into search engine
bodemon bin/indexer.js
- Start the app:
npm start
- View in browser at:
http://localhost:8000
- Address in use
Error: listen EADDRINUSE
ps aux | grep node
kill <node-process>
- Nothing returned when hitting
http://localhost:8000
Restart elasticsearch & mongodb and redo step 6 & 7