/hn-go

a restful hacker news story api using go & gin framework

Primary LanguageGoMIT LicenseMIT

hn-go

hn-go is a restful hacker news api & story data consolidator using gin framework

Installation

  1. Install the package
go get -v -u github.com/aacanakin/hn-go
  1. Install httpie // for cronjobs
sudo apt-get install httpie
  1. Install mongodb

  2. Install memcache

  3. Make the configuration

In the config.toml file, there exists various configuration options. Just change them according to your configuration.

  1. Run the server
go run app.go
  1. Run the jobs // schedule these jobs in crontab
sh crons.sh

Routes

- GET /stories/:type
    Description: Returns the stories in json format of github.com/aacanakin/hn

- PUT /stories/:type
    Description: Retrieves the stories and saves it to db

Type could be the following;
    - new
    - top 
    - job
    - ask
    - show