GithubHelp home page GithubHelp logo

shortcut.io's Introduction

scio

DB Setup

Create two databases with the owner "shortcut"

CREATE ROLE shortcut WITH LOGIN PASSWORD 'amazingpassword';
CREATE DATABASE shortcut_dev OWNER shortcut;
CREATE DATABASE shortcut_test OWNER shortcut;

Then load the schema, which is in priv/db

make schema_load

Lastly, enter the correct credentials in priv/database.config

Build

make

Test

make test

API

All requests should be sent with the content-type header set to application/json

After logging in, the cookie should be set and subsequent requests should include the cookie.

Signup

# REQUEST

POST /users
{
    username : [string],
    email    : [string],
    password : [string]
}


# RESPONSE

Status: 201
Body: [no body]

Login

# REQUEST

POST /sessions
{
    email    : [string],
    password : [string]
}


# RESPONSE

Status: 201
Headers: set-cookie=[session cookie string]
Body: [no body]

Create Shortcut

# REQUEST

POST /shortcuts
{
    url         : [string],
    title       : [string],
    description : [string],
    tags        : [ [string], [string], … ]
}


# RESPONSE

Status: 201
Body: [no body]

Get Shortcuts

# REQUEST

GET /shortcuts


# RESPONSE

Status: 200
Body: [
        {
            "id"            : 1,
            "url"           : "http://foo.com",
            "title"         : "Best Website ever",
            "description"   : "What more can I say",
            "screenshot_id" : "cc12c780-fa52-11e9-ae38-0023dfdf2726",
            "tags"          : ["foo", "bar", "baz"],
            "created_at"    : 1572360698,
            "updated_at"    : 1572360698
        },
        { … }
    ]

Update Shortcut

# REQUEST

PUT /shortcuts/[id]

{
    url         : [string],
    title       : [string],
    description : [string],
    tags        : [ [string], [string], … ]
}

# RESPONSE

Status: 200
Body: [
        {
            "id"            : 1,
            "url"           : "http://foo.com",
            "title"         : "Best Website ever",
            "description"   : "What more can I say",
            "screenshot_id" : "cc12c780-fa52-11e9-ae38-0023dfdf2726",
            "tags"          : ["foo", "bar", "baz"],
            "created_at"    : 1572360698,
            "updated_at"    : 1572360698
        },
        { … }
    ]`

DELETE Shortcut

# REQUEST

DELETE /shortcuts/[id]

# RESPONSE

Status: 201
Body:

shortcut.io's People

Contributors

hukl avatar sophiiistika 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.