Skip to content


registerExternalGet is used for registering API routes in your application. As the name suggests, it's used to register GET requests. This function takes two parameters:

  1. route is a string representing the route of the request.
  2. handler is the callback function that will be executed when a request comes in that matches the route.
  async (req, res): Promise<void> => {
    try {
      const account = await dapp.getLocalOrRemoteAccount(networkAccount)
      const network: NetworkAccount =
        parameters: {
          current: network.current,
          developerFund: network.developerFund,
          nextDeveloperFund: network.nextDeveloperFund,
          devWindows: network.devWindows,
          nextWindows: network.nextWindows,
          nextDevWindows: network.nextDevWindows,
          issue: network.issue,
          devIssue: network.devIssue,
    } catch (error) {
      res.json({ error })

Get used to using and understanding getLocalOrRemoteAccount. This method will need to be utilized in the majority of your API routes because of the way sharding works with Shardus.