Combo (combo v0.11.0)

View Source

A web framework, that combines the good parts of modern web development.

Summary

Functions

Returns the value of :json_library option, which specifies the module for JSON encoding.

Returns the value of :plug_init_mode option that controls when plugs are initialized.

Functions

json_library()

Returns the value of :json_library option, which specifies the module for JSON encoding.

The configured module is required to provide three functions:

  • decode!/1 — decodes a JSON binary, raising on invalid input
  • encode!/1 — encodes a term to a JSON binary, raising on encoding errors
  • encode_to_iodata!/1 — encodes a term to JSON iodata, raising on encoding errors

To customize the JSON library, including the following in your config/config.exs:

config :combo, :json_library, JSON

plug_init_mode()

Returns the value of :plug_init_mode option that controls when plugs are initialized.

It's recommended to set it to :runtime in development for compilation time improvements. It must be :compile in production (the default).

This option is passed as the :init_mode to Plug.Builder.compile/3.