Skip to content

vrundha/graffiti

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setup

Install dependencies

sudo apt-get install libpq-dev
pip install -r requirements.txt

Install and start CockroachDB https://www.cockroachlabs.com/docs/stable/secure-a-cluster.html

Start server

bash start.sh
python server.py

REST endpoints

GET

 curl http://127.0.0.1:5000/graffiti -X GET 

This should return

{
    "happy": [
        [
            "I'm married",
            1
        ],
        [
            "I passed!",
            1
        ]
    ],
    "sad": [
        [
            "my husband is leaving me",
            3
        ],
        [
            "committing crime",
            2
        ],
        [
            "I failed",
            1
        ],
        [
            "My wife broke my heart",
            2
        ]
    ]
}

POST

curl http://127.0.0.1:5000/graffiti -d "comm=I am a millionare&emo=happy" -X POST

It should return

{
    "success": true
}

Troubleshooting

ps -e | grep cockroach
lsof -i:5000

Demo

https://www.youtube.com/watch?v=JbKbpLlZE2M

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published