RevisionPlateEx v0.4.1 RevisionPlateEx.Router View Source

Define RevisionPlateEx Router. This module defines get and head methods via Plug.Router as standalone server. When anyone access to these methods , then this server return REVISION and status code as response.

To start this server, please set :revision_plate_ex as application in MyApp.Mixfile as example. After start MyApp, then :revision_plate_ex works automatically and start to return revision.

Example

defmodule MyApp.Mixfile do
  use Mix.Project

  def project do
    ...
  end

  def application do
    [
      applications: [:revision_plate_ex],
    ]
  end

  ...
end

This standalone server support two configurations. One is :http_port and another is :file_path. :http_port is listening port and :file_path is custom path to return response from.

These configuration is optional. Defaults are 4000 for :http_port and REVISION for :file_path.

Example

use Mix.Config

config :revision_plate_ex,
  http_port: 8000,
  file_path: "REVISION"

Link to this section Summary

Functions

Callback implementation for Plug.call/2

Callback implementation for Plug.init/1

Link to this section Functions

Callback implementation for Plug.call/2.

Callback implementation for Plug.init/1.

Link to this function start_link(port) View Source
start_link(integer()) :: {:ok, pid()}