FakeLink is a small backend that provides FLaaS (Fake Links as a Service), based on the Open Graph protocol
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 8080bin/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.
The application exposes the following endpoints:
GET /random
Returns the HTML for a random, public linkGET /links/:slug
Returns the HTML for a particular link, identified by its slugPOST /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
}
}
}