fakelink

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2016 License: MIT Imports: 8 Imported by: 0

README

Build Status

FakeLink is a small backend that provides FLaaS (Fake Links as a Service), based on the Open Graph protocol

Usage (via Docker)

A fully automated development environment for this project can be set up with Docker, Rocker and Docker-Compose. Here's how:

  • bin/docker-build.sh creates two images:
    • devlucky/fakelink-dev, for development purposes
    • devlucky/fakelink, for production purposes (lightweight deployable Go image)
  • bin/docker-run.sh runs the whole project, including its dependencies, and serves it on 8080
  • bin/docker-run.sh bash, where bash can be replaced by any other possible command, executes the command on the project's containers (including dependencies) in an interactive way.

HTTP

The application exposes the following endpoints:

  • GET /random Returns the HTML for a random, public link
  • GET /links/:slug Returns the HTML for a particular link, identified by its slug
  • POST /links Takes a multipart/form-data payload with two keys:
    • a file "image", to upload
    • a field "json" with the following structure:
{
    "link": {
        "private": false,
        "values": {
            "title": "A title for my fake link",
            "description": "..."
            
            # Other OpenGraph fields. See src/templates package 
            # to understand the accepted values and they way 
            # they will be used
        }
    }
}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
src
api
templates
The templates package contains the main templating logic the application uses to provide user-generated htmls
The templates package contains the main templating logic the application uses to provide user-generated htmls

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL