Trot v0.7.0 API Reference

Modules

Main Trot application. When added to a projects application list, Trot.Supervisor will be started. Also contains some generic parsing functions

Checks that a user has an authorized session before allowing them to access certain routes. By default, all routes are allowed

Plug for reloading modules on every request, allowing fast iteration during development

Plug for inserting a 404 not found response

Module for creating routes based on the URL path. Routes are specified using one of the HTTP method macros: get/2 post/2 put/2 patch/2 delete/2 options/2. The first argument is a the path to route to, and the second argument is the block of code to execute. See examples below

Server side rendering of HTML using EEx templates. When the application is compiled all of templates under a given path are loaded and compiled for faster rendering. A render/2 function is generated for every template under the module attribute @template_root

Templating engine for handling “.eex” files

Defines the API for rendering a template format

Templating engine for handling “.haml” files using Calliope

Templating engine for handling “.slim” files using Calliope

Module for handling API versioning within requests

Mix Tasks

Starts Trot application with mix trot.server

Command line options

This task accepts the same command-line arguments as app.start. For additional information, refer to the documentation for Mix.Tasks.App.Start. For example, to run trot.server without checking dependencies: mix trot.server —no-deps-check