Next.js Discord

Discord Forum

How to return text from nextjs app router route?

Answered
Southern rough shrimp posted this in #help-forum
Open in Discord
Southern rough shrimpOP
We can return json using Response.json() but how to return simple plain text? Response.text("something") does not exist.
Answered by Anay-208
return new Response("any text")
View full answer

3 Replies

Answer
@Anay-208 return new Response("any text")
Southern rough shrimpOP
lmao I tried without the new, I feel dumb sorry and thanks