Remove/replace the server's Hello world response?
Hello,
I would like to know if it is possible to remove the Hello World returned message when visiting the server url.
The line in question:
is generated on build so it seems I cannot modify it.
Thank you.
2 Replies
Hi @Hastur. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Yes, it is possible to modify or replace the default "Hello world" response from the server in Wasp. You can do this by using the server configuration options provided by Wasp. Here's how you can achieve this:
1. You can use the
setupFn
in the server
field of your app
declaration to add a custom route. This will allow you to override the default behavior.
2. In your main.wasp
file, add the following configuration:
3. Then, in your src/myServerSetupCode.js
file, you can add a custom route:
This will replace the default "Hello world" response with your custom response.
Source: Server Config (https://wasp-lang.dev/docs/project/server-config)
By using this method, you can customize the root route response without directly modifying the generated code, which would be overwritten on subsequent builds.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Hastur, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?Ah yeah we need to remove that! I wonder if what Kapa said here would actually work hm