Git Product home page Git Product logo

v4-resitev's Introduction

Quick start

Download the source code

~/workspace $ git clone <URL-to-repo>
~/workspace $ cd <repo>

~/workspace/v4-resitev (master) $ npm install //set express app  

Cerate the local database

Requirements

$ sudo apt-get remove mongodb-org mongodb-org-server
$ sudo apt-get autoremove
$ sudo rm -rf /usr/bin/mongo*
$ sudo rm /etc/apt/sources.list.d/mongodb*.list
$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
$ echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list
$ sudo apt-get update
$ sudo apt-get install mongodb-org mongodb-org-server
$ sudo touch /etc/init.d/mongod
$ sudo apt-get install mongodb-org-server

Create local serving system

~/workspace/v4-resitev (master) $ cd ~/workspace
~/workspace $ mkdir mongodb
~/workspace $ cd mongodb

~/workspace/mongodb $ mkdir data
~/workspace/mongodb $ echo 'mongod --bind_ip=$IP --dbpath=data --nojournal "$@"' > mongod
~/workspace/mongodb $ chmod a+x mongod

Host local database

~/workspace/mongodb $ ./mongod

Import the data into the database

Do this in new terminal. You need to leave the database to be served to access it.

$ mongoimport --db Comments --collection Comments --mode upsert --upsertFields name --jsonArray --file ~/workspace/v4-resitev/app_server/models/comments-mongodb.json

Start the app

~/workspace (master) $ cd ~/workspace/v4-resitev
~/workspace/v4-resitev (master) $ npm start

Host on Heroku (by your account)

$ curl https://cli-assets.heroku.com/install.sh | sh
$ sudo ln -s /usr/local/bin/heroku /usr/bin/heroku
$ heroku login -i
$ cd ~/workspace/v4-resitev
~/workspace/v4-resitev (master) $ heroku create
~/workspace/v4-resitev (master) $ git push heroku master
~/workspace/v4-resitev (master) $ heroku config:set MLAB_URI=mongodb://{user}:{pass}@dsX{koda-mLab-baze}.mlab.com:{koda-mLab-baze}/{database-name}
~/workspace/v4-resitev (master) $ heroku config:set NODE_ENV=production

Note that the collections' names of the local and mLabl database MUST match complitely (case as well)! The database names can differ.

v4-resitev's People

Contributors

filicmia avatar

Watchers

James Cloos avatar

Forkers

bc7608 mt5327

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.