# Week 2

In this session we will focus on connecting to a database, building an API, and using Postman to test our API endpoints. We will also cover how to structure our code for better maintainability and scalability.

## Contents

* [Preparation](https://program.hackyourfuture.dk/~/revisions/n2RGk5og1pvUUWu5OSlj/course-content/backend/node/week2/preparation)
* [Session Plan](https://program.hackyourfuture.dk/~/revisions/n2RGk5og1pvUUWu5OSlj/course-content/backend/node/week2/session-plan) (for mentors)
* [Assignment](https://program.hackyourfuture.dk/~/revisions/n2RGk5og1pvUUWu5OSlj/course-content/backend/node/week2/assignment)

## Session Learning goals

By the end of this session, you will be able to:

* [ ] Manage advanced database interactions in your service
  * [ ] Understand what Knex is and why to use it
  * [ ] Set up connections to your database using Knex
  * [ ] Execute `select`, `create`, `delete` and `update` queries using Knex Query Builder
* [ ] Implement all REST endpoints using Express
  * [ ] `POST`, `DELETE`, `PUT`
  * [ ] Use appropriate error handling to understand and debug issues
* [ ] Configure Postman for advanced backend development
  * [ ] Creating collections and saving requests
  * [ ] Set up multiple environments
  * [ ] Managing secrets
  * [ ] Create basic test suites
