Mooncore (mooncore v0.2.4)

Copy Markdown

Mooncore — A lightweight, action-based api framework for Elixir.

Mooncore is a Phoenix alternative built around the action pattern: every feature is an action (a named operation mapped to a module function), and actions are transport-agnostic — the same action works via HTTP, WebSocket, local Elixir call, or any other protocol.

Configuration

config :mooncore,
  port: 4000,
  router: MyApp.Router,
  app_module: MyApp.App,
  jwt: [key: "...", issuer: "myapp"],
  pools: [:default],
  before_action: [],
  after_action: []

Summary

Functions

Get a mooncore config value.

Get a nested mooncore config value.

Get JWT config.

Check if mooncore_dev_tools is fully enabled.

Functions

config(key, default \\ nil)

Get a mooncore config value.

config(key, subkey, default)

Get a nested mooncore config value.

jwt(arg1)

Get JWT config.

mooncore_dev_tools_enabled?()

Check if mooncore_dev_tools is fully enabled.

Requires BOTH:

  • config :mooncore, mooncore_dev_tools: true
  • MOONCORE_DEV_TOOLS=true environment variable

This two-gate system prevents accidental exposure of dev tools when deploying to a server with a misconfigured config.