Momentum logo
Team 12 Classroom

🐻 Designing Your Models & Your API 🐻

Posted on Jun 1st, 2022

🗓️ Today’s Topics

  • Models for your collaborative project
  • Designing the urls you need
  • Review permissions & CORS

🎯 Project

Today you should have your models nailed down and be able to work with them in the admin and the shell – that is, you can save them to the database and retrieve them, and all the relationships work properly.

You should have a WRITTEN DOWN plan for at least the basic set of urls that your front-end will need. You may make changes to this as you go but you need a place to begin.

When creating your list of endpoints, remember: only build what you need.

  • What lists or collections of data will you need to return?
  • What single resources will you need to return?
  • What HTTP methods will you need to support for your urls?
  • Which routes will need to be authenticated and which do not require authentication?
  • Will you need to restrict any actions at the object level?

By Friday

Your API should…

  • be returning JSON for GET requests for questions and answers / cards and friends
  • be able to accept POST requests to create questions and answers / cards and friends

🔖 Resources

Permissions

CORS

Databases: Deeper Dive into the Theory Behind the Best Practices

👾 Code

Back to home