Skip to content

Instantly share code, notes, and snippets.

What would you like to do?

AdonisJS: Simple API Cheatsheet

A cheatsheet to help you as you build a simple API using AdonisJS framework for NodeJS.

Important Links

My Contact Info

Project Overview

  • Customers -- name, description
  • Projects -- name, description, customer_id
  • Tasks -- name, description, project_id

Common Mistakes

These mistakes are a common source for my bugs:

  • forgetting the 'await' keyword
  • creating migrations in the wrong order

Understanding Models and the Query Builder

Further Study

Suggestions for More Practice

  1. Practice using migrations to add / delete tables and columns after you've interacted with the database a while.
  2. Can you use seeders to populate new columns added to an existing customers table or projects table?
  3. What's another way to handle the routing so you don't have to write GET, POST, etc. individually? hint: Watch out on the delete() method!
  4. How would you use the query builder to JOIN tasks to a project you want to GET using the show() method?
  5. How would you use Lucid to define the relationship between Projects and Tasks so you can load Projects WITH tasks?
  6. How can you implement basic authentication?
Copy link

ujjwal-kr commented Mar 31, 2019

#You Should Make A Series On Auth0

Copy link

AsadJivani commented Nov 22, 2020

API Primer URL is not working currently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment