RegisterHttp is meant for public (no auth) APIs, custom callback handlers or anything that requires lower-level control over the http request flow. We don’t yet have detailed documentation on this but there’s plenty of resources that cover this topic online as it follows the standard Go Http handler interface.
If you do not require the above, the standard way to have custom APIs in Nakama is using RegisterRpc.
If this is not what you’re looking for, please clarify what you’re trying to achieve.
You can also have a look at our template project to get started.
What I want is to get data such as storage, leaderboard, etc. using rpc without authentication. I thought registerHttp could use it like that. If I use registerRpc, I have to create an account for dummy, but I don’t want to. Is there any other way?
Ok if you’d like to bypass Nakama standard auth then yeah, RegisterHttp is the way to go, I see no issue with the approach I just wanted to make sure you’re aware that the endpoints will be publicly accessible.
Is there any problem with creating global structure instances when doing InitModule like above, except for having open access to endpoints?
I really don’t know if that’s the best way.