Subscribe to access all episodes. View plans →
Alchemist's Edition
In this episode we’ll use Plug to restrict access to our JSON API unless the request includes a valid API key.
In this episode we’ll use PlugCanonicalHost to redirect all requests from a non-canonical host to the canonical one.
Now that we have a Plug.Router application working in development, let’s deploy it. We’ll deploy our app to Heroku.
Plug is a great option for smaller sites that don’t need a database and have limited routes. Here we’ll use Plug.Router to build a simple website that uses EEx to precompile our temples.
Often when testing Phoenix controllers you’ll need to initialize the session with data. In this episode we’ll learn how to do just that using the Plug.Test module.
Now that we have our application generating API keys, we need to validate incoming API requests. In part 2 of this series, we’ll create a plug that validates the API key used.
In this episode we’ll be exploring one method to simplify Phoenix controllers using action_fallback. action_fallback allows you to specify a plug to handle errors in your controller.
Now that we’ve created our ‘Order History’ pages, we need to make sure only the respective customers are able to view their order history. We’ll use Plug to help us do this.
In part 3 we tackle URLs. We create a new URL structure to go along with our new app. Then we use Plug to create a custom redirect module to handle traffic to the old URL structure.
© 2024 HEXMONSTER LLC