Files
freeCodeCamp/api
Sem Bauke a980ac03e5 feat: introduce /update-my-profileui route in new API (#49827)
* feat: add response codes

* fix: update TypeBox imports

* refactor: convert inject based tests to supertest

* feat: require authentication to use route

* test: confirm db is updated as expected

* fix: respond appropriately on error

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Co-authored-by: Niraj Nandish <nirajnandish@icloud.com>
Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
2023-04-18 15:01:26 +00:00
..
2023-03-29 18:08:38 +05:30

Working on the new api

Connecting to local database

The api uses the ORM Prisma and it needs the MongoDB instance to be a replica set.

Atlas

If you use MongoDB Atlas, the set is managed for you.

Local

The simplest way to run a replica set locally is to use the docker-compose file in /tools. First disable any running MongoDB instance on your machine, then run the docker-compose file.

cd tools
docker compose up -d

Login in development/testing

During development and testing, the api exposes the endpoint GET auth/dev-callback. Calling this will log you in as the user with the email foo@bar.com by setting the session cookie for that user.