Skip to content

digital-peace-talks/opinio-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Polarizer backend

Installation

Clone repo

git clone [email protected]:digital-peace-talks/polarizer-backend.git
cd polarizer-backend

Create virtualenv and install python dependencies

python3 -m venv ./venv
. ./venv/bin/activate
pip install -r requirements.txt
export PYTHONPATH=$(pwd)

Usage

Start server

flask --app rest/server run -p 4080

Register new session (required for any further API interactions)

http :4080/register_session

Get current layout

http ':4080/<session_id>/layout'

Get an edge's value

http ':4080/<session_id>/edge?left=33&right=39'

Update an edge (returns updated graph)

Parameter ranges:

dissent : 0 to 10
respect: -5 to 5

http ':4080/<session_id>/update?left=33&right=39&dissent=1&respect=3'

Update an edge (POST version)

http ':4080/<session_id>/update' left=33 right=39 dissent=1 respect=3

Update an edge, returning an svg

Parameter ranges:

http ':4080/<session_id>/update_svg?left=33&right=39&dissent=1&respect=3'

(Sorry for the brevity :))

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published