YerkoPalma / hn-reign

Home Page:https://glacial-atoll-21302.herokuapp.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HnReign

Simple Hacker News reader.

Install

First you need to have MongoDB and Node.js installed. Then do the following

# clone the repo

git clone https://github.com/YerkoPalma/hn-reign.git
cd hn-reign

# install dependencies
npm install

Usage

For a development run, you need to first run your local mongo server

mongod

Once this is running, you can just hit npm run dev

npm run dev

This will run locally the api server and the client app. Now open http://localhost:4200/ to see your app, it should look like this

vista inicial

This is because the database updates every one hour through a cron job. If you want to load data inmediatly, make a POST request to http:localhost:9090/api/feed (no body is required for this request). Now reload the client, it should look like this.

con datos cargados

Deploy

The app is already deployed to heroku in this link. If you want to deploy to your own heroku instance (assuming you already have the heroku cli client installed).

# create your app
heroku create

# install mLab addon
heroku addons:create mongolab

Now we need two changes in our env vars, first, set NPM_CONFIG_PRODUCTION to false so dev dependencies get installed, and then, create a env var with the name of the assigned database by mongolab

heroku config:set NPM_CONFIG_PRODUCTION=false
heroku config:set MONGODB_DB=<your_db>

Then commit your changes to heroku and you are done

git add .
git commit -m "heroku deploy"
git push heroku master

About

https://glacial-atoll-21302.herokuapp.com/


Languages

Language:TypeScript 77.4%Language:HTML 9.4%Language:JavaScript 8.7%Language:CSS 4.6%