Skip to content

sk8erwitskil/KVServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

KVserver

An HTTP server for reading and storing simple values. Each item will be stored in a list so you can add multiple items to the same key as well as remove just single items from a key list.

Basically, this is an HTTP frontend to redis.

The server is started using TornRPC (https://github.com/sk8erwitskil/TornRPC) but you can make HTTP calls to the server as well.

curl -H "User-Agent: TornRPC" -X GET -d "key=kyle" http://my_ip.address.com:80/get
curl -H "User-Agent: TornRPC" -X GET -d "key=kyle&val=owner" http://my_ip.address.com:80/add

The response will be a JSON object like {"response": ["owner"]}. The benefit of this is not requiring any extra libraries to talk to the server.

Dependencies

  • tornado
  • redis
  • TornRPC

Example

First start the server.

python server.py --port=80 --redis=127.0.0.1:6379

Then in a different location simply

from tornrpc.client import TornRPCClient
client = TornRPCClient("my_ip.address.com:80")
print client.add("github", "https://github.com/sk8erwitskil")
print client.add("github", "https://github.com/sk8erwitskil/TornRPC")
for item in client.get("github"):
  print item

About

A simple key-value RPC/HTTP server backed by redis

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages