Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
bin
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

#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

About

A popularity ranking server inspired by Hacker News.

Resources

License

Releases

No releases published

Packages

No packages published