Skip to content
Snippets Groups Projects
README.md 980 B
Newer Older
Harpo Roeder's avatar
Harpo Roeder committed
# Polycentric HTTP Bridge

The Polycentric HTTP Bridge allows programmatic control of a Polycentric client via a REST API.
Harpo Roeder's avatar
Harpo Roeder committed

Harpo Roeder's avatar
Harpo Roeder committed
## Configuration

```bash
export POLYCENTRIC_HTTP_BRIDGE_PORT=... # default 5005
export POLYCENTRIC_HTTP_BRIDGE_STATE_DIRECTORY=... # default ./state
```

## Build Quick start
Harpo Roeder's avatar
Harpo Roeder committed

```bash
git clone --recursive git@gitlab.futo.org:polycentric/polycentric.git
./build-vendored.sh
npm install
npm run build
npm start
```
Harpo Roeder's avatar
Harpo Roeder committed

## API

```bash
# Set Username
curl -X POST http://localhost:5005/username --data 'Polycentric HTTP Bridge'
# Set Description
Harpo Roeder's avatar
Harpo Roeder committed
curl -X POST http://localhost:5005/description --data 'I am a bridge'
Harpo Roeder's avatar
Harpo Roeder committed
# Add Server
curl -X POST http://localhost:5005/server --data 'https://srv1-prod.polycentric.io'
# Remove Server
curl -X DELETE http://localhost:5005/server --data 'https://srv1-prod.polycentric.io'
# Post
curl -X POST http://localhost:5005/post --data 'Hello World!'
# Get a Polycentric link to this System
curl http://localhost:5005/link
Harpo Roeder's avatar
Harpo Roeder committed
```