mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-01-06 15:03:08 -05:00
* feat(api): add sentry plugin Apply suggestions from code review Revert "feat(api): add sentry plugin" This reverts commit fcde4ee03e9b83e335a6a2bccd490490e9993597. install sentryNode WIP: create sentry debug WIP: find out why use errorhandler isn't typed correct install sentry add the deleted sentry code create sentry plugin * fix error found through sentry * Polish sentry plugin Co-authored-by: Niraj Nandish <nirajnandish@icloud.com> * duplicate the changes made in the other plugin * add done to seterrorHandler * Fix a typo in sentry option Co-authored-by: Naomi Carrigan <nhcarrigan@gmail.com> * Stop the dns from running if a DSN wasn't provided Co-authored-by: Naomi Carrigan <nhcarrigan@gmail.com> * Polish the function and check the variable value Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com> * check the dsn dashboard in the env * export dsn value if it isn't sentrydashboard Co-authored-by: Naomi Carrigan <nhcarrigan@gmail.com> * when the value is undefined init errors * revert the if statement * throw an error whenever an environment variable is not right --------- Co-authored-by: Niraj Nandish <nirajnandish@icloud.com> Co-authored-by: Naomi Carrigan <nhcarrigan@gmail.com> Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
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.