Giter VIP home page Giter VIP logo

chopine's Introduction

chopine

A small REST-api msg-server in bottle

Synopsis

En meddelandetjänst, med vilken man kan skicka textmeddelanden till mottagare och läsa dessa som mottagare. Man kan

  1. Skicka meddelande till en mottagare, identifierad med epostadress, telefonnummer eller användarnamn.

  2. Hämta nya (sedan förra hämtningen) meddelanden till mottagare

  3. Ta bort ett eller flera meddelanden för en mottagare

  4. Hämta tidsordnade meddelanden till en mottagare enligt start och stopp index

Implementationen har ett REST-API

Credits

The server is based on the python web-framework bottle. The file bottle.py is copied verbatim from them.

Usage instructions

install on macosx:

  > sudo easy_install pip
  > pip install webtest 

Start server:

    ./chopine.py <port>

Run Tests:

    ./chopine.py

Add a user:

    curl -d "user=pelle&phone=456&email=pelle@uppsala" http://localhost:8080/add_new_user

List Users (try me!):

    curl http://localhost:8080/users

Dump a user's info:

    curl http://localhost:8080/users/pelle

Add a message:

    curl -d "to=foo&from=ara&msg=hello world." http://localhost:8080/add_msg

Delete some messages:

    curl  http://localhost:8080/msgs/pelle?id=1,3

Fetch messages:

    curl  http://localhost:8080/msgs/pelle
    curl  http://localhost:8080/msgs/pelle?lb=3
    curl  http://localhost:8080/msgs/pelle?lb=2&ub=3

Fetch new messages:

    curl  http://localhost:8080/msgs/pelle?new

chopine's People

Contributors

ara4711 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.