ProductPromotion
Logo

Elixir

made by https://0x3d.site

GitHub - cloud8421/dragonfly-server: Elixir app to serve Dragonfly images
Elixir app to serve Dragonfly images. Contribute to cloud8421/dragonfly-server development by creating an account on GitHub.
Visit Site

GitHub - cloud8421/dragonfly-server: Elixir app to serve Dragonfly images

GitHub - cloud8421/dragonfly-server: Elixir app to serve Dragonfly images

Dragonfly server

Build Status

This application can be used to serve Dragonfly urls.

Limitations

  • Doesn't support the full Dragonfly feature set (for now).
  • Limited to Imagemagick.

Setup

Dependencies

Erlang

IMPORTANT: Due to a known bug in Erlang 17.3, fetching urls with an https scheme are not processed correctly and throw an exception.

Please use Erlang >= 17.4, available at https://www.erlang-solutions.com/downloads/download-erlang-otp.

Elixir

To install elixir on a Mac, brew install elixir (you may need to brew update first).

Alternatively, you can follow these instructions.

Imagemagick

To install Imagemagick with png support, run brew install jpeg libpng imagemagick.

Goon

Communication with Imagemagick is managed by Goon, a middleman needed to polyfill the incomplete Port implementation provided by Erlang (see here for more information).

Download the binary and add it to a directory available in your $PATH.

App setup

$ mix deps.get

This will install all needed packages.

Then, copy the example environment file and make the necessary adjustments.

$ cp .env.example .env

Run the app in development

$ iex -S mix

Starts the app and opens a console.

Run tests

$ mix test

General api

Images are served at the entry point defined in config.exs, set as default at /media/:payload/:filename.

Note that both params in the url scheme are needed by the application.

Admin api

The app exposes an admin api that can be used to programmatically expire an image and all its associated resources. Endpoints are:

  • GET image (shows steps necessary to generate image)
  • DELETE image (expires all caches involved in the generation of the image)

Given an image url in the form of:

http://example.com/media/12345/untitled.jpg

It can be deleted by sending a DELETE request to the following endpoint:

http://example.com/admin/media/12345/untitled.jpg

From the command line:

$ curl -XDELETE http://example.com/admin/media/12345/untitled.jpg

The expected response is a 202, which indicates that the cache expiry has been scheduled and will be performed asyncronously.

The steps necessary to generate the image can also be examined at:

http://example.com/admin/media/12345/untitled.jpg

From the command line:

$ curl http://example.com/admin/media/12345

Deploy on Heroku

The app runs only on Cedar-14 and requires the multi-buildpack as it uses a custom Elixir buildback (it includes Goon).

Buildpacks are defined in .buildpacks.

Please follow instructions at https://github.com/ddollar/heroku-buildpack-multi.

Articles
to learn more about the elixir concepts.

Resources
which are currently available to browse on.

mail [email protected] to add your project or resources here 🔥.

FAQ's
to know more about the topic.

mail [email protected] to add your project or resources here 🔥.

Queries
or most google FAQ's about Elixir.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory