The Waitlist API is designed to manage a simple waitlist. It provides endpoints to add an email to the waitlist and retrieve all emails in the waitlist. Access to the getWaitlist endpoint is restricted and requires a auth token for authentication.
- Clone the repository to your local machine.
- Run
npm installto install all dependencies. - Set up your MongoDB database.
- Create a
.envfile in the root of your project and add your mongodb url and auth token like so:AUTH=YourSecretBearerToken MONGODB_URL=url. - Start the server with
npm start.
Add an email address to the waitlist.
{
"email": "[email protected]"
}200 OKon success:
{
"message": "Email added to the waitlist."
}400 Bad Requestif the email is invalid or missing:
{
"message": "Email address is required."
}500 Internal Server Errorif there's a server error:
{
"message": "Error message"
}Retrieve all emails in the waitlist. This endpoint requires a bearer token for authentication.
Authorization: Bearer YourSecretBearerToken
200 OKon success:
[
"[email protected]",
"[email protected]",
"[email protected]"
]401 Unauthorizedif the bearer token is missing.403 Forbiddenif the bearer token is invalid.500 Internal Server Errorif there's a server error.
All other undefined routes will return a 404 H3llo MudaFvcka error.
This API uses bearer token authentication to protect the /getwaitlist endpoint. Ensure that the bearer token is kept secret and is only shared with authorized clients.