Giter VIP home page Giter VIP logo

backend's Introduction

BackEnd

Web services for nodebnb

Requirements

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

First time setup

  1. Clone the repo: git clone https://github.com/nodebnb/BackEnd.git

  2. Go into folder: cd BackEnd

  3. Install dependencies: npm install

  4. Create local MongoDB database called nodebnb

  5. Create ElasticSearch index curl -XPUT 'http://localhost:9200/listings/'

  6. Load history data into MongoDB mongoimport --db nodebnb --collection listings --file data/bnb.json

    Or crawl new data bodemon bin/scraper.js

  7. Index data into search engine bodemon bin/indexer.js

Start

  1. Start the app: npm start
  2. View in browser at: http://localhost:8000

Demo

Troubleshootings

  1. Address in use

Error: listen EADDRINUSE

ps aux | grep node
kill <node-process>
  1. Nothing returned when hitting http://localhost:8000

Restart elasticsearch & mongodb and redo step 6 & 7

Screenshot

Search page

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.