https://github.com/yerkopalma/hn-reign
https://github.com/yerkopalma/hn-reign
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/yerkopalma/hn-reign
- Owner: YerkoPalma
- Created: 2019-06-14T01:16:29.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-06-16T00:47:11.000Z (almost 6 years ago)
- Last Synced: 2025-01-25T07:11:21.229Z (4 months ago)
- Language: TypeScript
- Homepage: https://glacial-atoll-21302.herokuapp.com/
- Size: 341 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HnReign
Simple Hacker News reader.
## Install
First you need to have [MongoDB][MongoDB] and [Node.js][Node] installed.
Then do the following```bash
# clone the repogit 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
```bash
mongod
```Once this is running, you can just hit `npm run dev`
```bash
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
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.
## 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][heroku-cli] client installed).```bash
# 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```bash
heroku config:set NPM_CONFIG_PRODUCTION=false
heroku config:set MONGODB_DB=
```Then commit your changes to heroku and you are done
```bash
git add .
git commit -m "heroku deploy"
git push heroku master
```[MongoDB]: https://www.mongodb.com/
[Node]: https://nodejs.org/en/
[link]: https://glacial-atoll-21302.herokuapp.com/
[heroku-cli]: https://devcenter.heroku.com/articles/heroku-cli