const api = await app.require('api');
You can only use this from within browser dev console (and some limited other places).
Instead you should use
require(['api'], (api) => { api.put(`/groups/test/membership/1550`).then(() => { ... }); });I followed the walk-through to get things setup on Heroku and somehow this question never occurred to me:
Does NodeBB support load-balancing? Are there any in-memory data structures that aren't managed through Redis/Mongo (web sockets?) that would cause problems with spinning up extra web dynos to handle additional user load?
Untested, but in a nutshell, theoretically, there shouldn't be any problems.
All user data is stored on Redis, including sessions, meaning it is possible to spin up a cluster of NodeBB instances for load balancing purposes.
Outside of heroku, I've been thinking of using something like pm2
to try this out.