Hi welcome,

It’s been over a year now of working with Nuxt.js and graphQL but it’s only recently I’ve found out a way of saving user’s JWT token inside cookies with the server middleware option of Nuxt.js.

If you don’t know what the server middleware is, I strongly suggest you to see it in the Nuxt.js’s documentation but it’s just a way of binding an api or running a server within our Nuxt.js application.

We won’t build a graphQL api from scratch for this article, I assume you already have an API that generates JWT tokens for the authentication and…


So you’ve been wondering how to build rest APIs using Elixir and Plug whether it’s for a frontend application or a microservice ? We are going to build one which will return JSON responses and test it.

Installation

Before starting anything, you have to make sure you have Elixir and Mix working correctly on your machine and then we will use a simple and basic boilerplate in order to avoid all complications.

We will call our application movie_api_plug, so we will have to run these commands below:

git clone --depth=1 https://github.com/imhassane/elixir-plug-rest-boilerplate.git movie_api_plug

mix deps.get

Your project architecture should look like this…


As I’m currently working on a personnal project that involved building a service with Elixir without using Phoenix, I first struggled to find an example that was well enough explained but I eventually understood more about Plug and Cowboy so I decided to help you guys who are in the same position.

We will build a movie api that will implement all CRUD operations, the goal is not to build a full api with authentication and all other stuffs involved but just to show how to return json response, how to deal with Mongo integration, communicating with other processes and…

Hassane Sow

Just a passionate human being. You can find me on github at: https://github.com/imhassane

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store