204 Errors from Endpoints regardless of function

I am following this tutorial [https://www.youtube.com/watch?v=mrHNSanmqQ4]

I get 204 errors for all my requests when I test them in my react web app or from Insomnia. The functions produce the correct results in the Realms editor.

The endpoints are set to use System Authentication and I am allowing access from all IP addresses.

The result is the same regardless of the body of the function. For example:

exports = async function({ query, headers, body}, response) {
const collection = context.services.get(“mongodb-atlas”).db(“sample_restaurants”).collection(“restaurants”);
const cuisines = await collection.distinct(“cuisine”);
return cuisines
};
produces the same result as
exports = async function({ query, headers, body}, response) {
return “Hello world”;
};

The call from the realm console is just
exports({})

Result from the realm console is

ran at 1658043458424
took 402.199783ms
result:
[
“Afghan”,
“African”,
“American”,
“Armenian”,
“Asian”,
“Australian”,
“Bagels/Pretzels”,
“Bakery”,
“Bangladeshi”,
“Barbecue”,
“Bottled beverages, including water, sodas, juices, etc.”,
“Brazilian”,
“Café/Coffee/Tea”,
“Café/Coffee/Tea”,
“Cajun”,
“Californian”,
“Caribbean”,
“Chicken”,
“Chilean”,
“Chinese”,
“Chinese/Cuban”,
“Chinese/Japanese”,
“Continental”,
“Creole”,
“Creole/Cajun”,
“Czech”,
“Delicatessen”,
“Donuts”,
“Eastern European”,
“Egyptian”,
“English”,
“Ethiopian”,
“Filipino”,
“French”,
“Fruits/Vegetables”,
“German”,
“Greek”,
“Hamburgers”,
“Hawaiian”,
“Hotdogs”,
“Hotdogs/Pretzels”,
“Ice Cream, Gelato, Yogurt, Ices”,
“Indian”,
“Indonesian”,
“Iranian”,
“Irish”,
“Italian”,
“Japanese”,
“Jewish/Kosher”,
“Juice, Smoothies, Fruit Salads”,
“Korean”,
“Latin (Cuban, Dominican, Puerto Rican, South & Central American)”,
“Mediterranean”,
“Mexican”,
“Middle Eastern”,
“Moroccan”,
“Not Listed/Not Applicable”,
“Nuts/Confectionary”,
“Other”,
“Pakistani”,
“Pancakes/Waffles”,
“Peruvian”,
“Pizza”,
“Pizza/Italian”,
“Polish”,
“Polynesian”,
“Portuguese”,
“Russian”,
“Salads”,
“Sandwiches”,
“Sandwiches/Salads/Mixed Buffet”,
“Scandinavian”,
“Seafood”,
“Soul Food”,
“Soups”,
“Soups & Sandwiches”,
“Southwestern”,
“Spanish”,
“Steak”,
“Tapas”,
“Tex-Mex”,
“Thai”,
“Turkish”,
“Vegetarian”,
“Vietnamese/Cambodian/Malaysia”
]
result (JavaScript):
EJSON.parse(‘[“Afghan”,“African”,“American”,“Armenian”,“Asian”,“Australian”,“Bagels/Pretzels”,“Bakery”,“Bangladeshi”,“Barbecue”,“Bottled beverages, including water, sodas, juices, etc.”,“Brazilian”,“Café/Coffee/Tea”,“Café/Coffee/Tea”,“Cajun”,“Californian”,“Caribbean”,“Chicken”,“Chilean”,“Chinese”,“Chinese/Cuban”,“Chinese/Japanese”,“Continental”,“Creole”,“Creole/Cajun”,“Czech”,“Delicatessen”,“Donuts”,“Eastern European”,“Egyptian”,“English”,“Ethiopian”,“Filipino”,“French”,“Fruits/Vegetables”,“German”,“Greek”,“Hamburgers”,“Hawaiian”,“Hotdogs”,“Hotdogs/Pretzels”,“Ice Cream, Gelato, Yogurt, Ices”,“Indian”,“Indonesian”,“Iranian”,“Irish”,“Italian”,“Japanese”,“Jewish/Kosher”,“Juice, Smoothies, Fruit Salads”,“Korean”,“Latin (Cuban, Dominican, Puerto Rican, South & Central American)”,“Mediterranean”,“Mexican”,“Middle Eastern”,“Moroccan”,“Not Listed/Not Applicable”,“Nuts/Confectionary”,“Other”,“Pakistani”,“Pancakes/Waffles”,“Peruvian”,“Pizza”,“Pizza/Italian”,“Polish”,“Polynesian”,“Portuguese”,“Russian”,“Salads”,“Sandwiches”,“Sandwiches/Salads/Mixed Buffet”,“Scandinavian”,“Seafood”,“Soul Food”,“Soups”,“Soups & Sandwiches”,“Southwestern”,“Spanish”,“Steak”,“Tapas”,“Tex-Mex”,“Thai”,“Turkish”,“Vegetarian”,“Vietnamese/Cambodian/Malaysia”]’)

So I did figure this out. “Respond With Result” was set to false by default. After setting it to true I started getting 200’s and responses again.