Skip to content
A popularity ranking server inspired by Hacker News.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets
bin
models
node_modules
public/stylesheets
routes
views
LICENSE
README.md
app.js
config.js
package.json

README.md

#Hot Score Server

Hot Score Server ranks posts based on popularity with a time decay. The implementation is similar to Hacker News. It is written in node.js with postgres as the database. For this demo, an internal cron function updates each item's score each second.

##Installation

Download or clone the repo. Install Postgres and create a database called 'hotscore'.

-- In the terminal, start psql and run
CREATE DATABASE hotscore

Make sure PostgreSQL is running on port 5432. Run the database setup script in the '/models' directory.

node database.js

Return to the root directory and run.

npm start

Open http://localhost:3000 in your browser.

##Usage

Hot Score Server is a http service. Use curl to interface it.

####Create item

curl --data "title=Some Title Here" http://localhost:3000/api

####Update item's likes

curl -X PUT --data "likes=4" http://localhost:3000/api/:item_id

:item_id denotes an item's primary id in the database.

####Delete item

curl -X DELETE http://localhost:3000/api/:item_id

##View Data

##Author Lawrence Tran

##License GPL

You can’t perform that action at this time.