kochman / safetynet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

safetynet

Requirements

Ensure these are installed before continuing.

Getting started

safetynet is written in Python. To run safetynet for development:

Installing

git clone git@github.com:kochman/safetynet.git
cd safetynet
pipenv install --three

Running

pipenv shell
python app.py

API endpoints

  • GET /api/profiles:

    Returns a JSON list of profiles that safetynet thinks this user is interested in. Right now, that's every profile, but eventually will be location-based.

  • POST /api/profiles:

    Create a new profile. The body should be a JSON object similar to the following:

    {
        "name": "Safetynet User",
        "latitude": 42.733011,
        "longitude": -73.667795,
        "status": "A freeform text field for users to provide information..."
    }
    
  • POST /api/profiles/<id>:

    Update an existing profile with a specific ID. This endpoint expects an object with two fields, i.e.:

    {
        "profile": <profile object>,
        "token": <token returned from `/api/profiles`>
    }
    

    This will only succeed if the token matches the one generated by POSTing to /api/profiles.

About


Languages

Language:JavaScript 47.8%Language:CSS 35.5%Language:HTML 15.3%Language:Python 1.2%Language:Dockerfile 0.1%Language:Shell 0.0%