Magellan-Microservice Hex.pm

Build StatusInline docs

This is a simple Microservice written in Elixir. The Magellan-Microservice provides a basic app-status and health page. It also provides the possibility to plug in a custom router.

Documentation can be found here.

Installation

Add the following line to your mix.exs deps:

{:magellan_microservice, "0.3.0"}

Example

To start the Microserice, just add it to the applications in your mix.exs.

 def application do
    [applications: [:magellan_microservice],
    mod: {Your.App, []}]
  end

To use your custom plug-router, register it at start-up time.

MagellanMicroservice.Router.register_router(Example.Router)

To add a status-function to the app-status, just pass it to: register_status_fun.

MagellanMicroservice.AppStatus.register_status_fun(:name, &your_status_fun/0)

Configuration

The following configuration has to be provided.

config :magellan_microservice,
  status: "/status",
  health: "/health",
  port: 8080

Test

To run the test, you need to provide the PORT as an env-variable.

PORT=9121 mix test

Next Steps