Giter Club home page Giter Club logo

openshift-mongo-node-express-example's Introduction

#The code to accompany the Spatial Node Mongo blog piece

This code actually belongs to a blog piece written on OpenShift.com

========

Running on OpenShift

Create an account at https://www.openshift.com

Create a Node.js application with MongoDB

rhc app create nodews nodejs-0.10 mongodb-2 --from-code=https://github.com/openshift-quickstart/openshift-mongo-node-express-example.git

By default flag --from-code will add this repository as an upstream, which can be use later to pull updates.

Now, ssh into the application.

rhc ssh

Add the data to a collection called parkpoints:

mongoimport -d nodews -c parkpoints --type json --file $OPENSHIFT_REPO_DIR/parkcoord.json  -h $OPENSHIFT_MONGODB_DB_HOST  -u admin -p $OPENSHIFT_MONGODB_DB_PASSWORD

Create the spatial index on the documents:

mongo
use nodews
db.parkpoints.ensureIndex( { pos : "2d" } );

Once the data is imported you can now checkout your application at:

http://nodews-$yournamespace.rhcloud.com/ws/parks

License

This code is dedicated to the public domain to the maximum extent permitted by applicable law, pursuant to CC0 http://creativecommons.org/publicdomain/zero/1.0/

openshift-mongo-node-express-example's People

Contributors

banzaiman avatar bparees avatar danmcp avatar ironcladlou avatar kraman avatar mrunalp avatar soltysh avatar thesteve0 avatar

Watchers

 avatar  avatar

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.