How to use the decentraland-server.server.handleRequest function in decentraland-server

To help you get started, we’ve selected a few decentraland-server examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github decentraland / agora / src / Vote / Vote.router.ts View on Github external
mount() {
    /**
     * Returns a full vote by id
     */
    this.app.get('/votes/:id', server.handleRequest(this.getVote))

    /**
     * Returns the votes for a poll
     */
    this.app.get('/polls/:id/votes', server.handleRequest(this.getPollVotes))

    /**
     * Creates a new vote, returns the new id
     */
    this.app.post('/votes', server.handleRequest(this.createVote))
  }
github decentraland / agora / src / Vote / Vote.router.ts View on Github external
mount() {
    /**
     * Returns a full vote by id
     */
    this.app.get('/votes/:id', server.handleRequest(this.getVote))

    /**
     * Returns the votes for a poll
     */
    this.app.get('/polls/:id/votes', server.handleRequest(this.getPollVotes))

    /**
     * Creates a new vote, returns the new id
     */
    this.app.post('/votes', server.handleRequest(this.createVote))
  }
github decentraland / agora / src / Receipt / Receipt.router.ts View on Github external
mount() {
    /**
     * Returns all receipts
     */
    this.app.get('/receipts', server.handleRequest(this.getReceipts))

    /**
     * Returns a receipt by id
     */
    this.app.get('/receipts/:id', server.handleRequest(this.getReceipt))

    /**
     * Returns account receipts
     */
    this.app.get(
      '/accounts/:address/receipts',
      server.handleRequest(this.getAccountReceipts)
    )
  }
github decentraland / agora / src / Receipt / Receipt.router.ts View on Github external
mount() {
    /**
     * Returns all receipts
     */
    this.app.get('/receipts', server.handleRequest(this.getReceipts))

    /**
     * Returns a receipt by id
     */
    this.app.get('/receipts/:id', server.handleRequest(this.getReceipt))

    /**
     * Returns account receipts
     */
    this.app.get(
      '/accounts/:address/receipts',
      server.handleRequest(this.getAccountReceipts)
    )
  }
github decentraland / agora / src / Translation / Translation.router.ts View on Github external
mount() {
    /**
     * Returns the translations for a given locale
     * @param  {string} locale - locale name
     * @return {array}
     */
    this.app.get(
      '/translations/:locale',
      server.handleRequest(this.getTranslations)
    )
  }
github decentraland / agora / src / Poll / Poll.router.ts View on Github external
mount() {
    /**
     * Returns all polls
     */
    this.app.get('/polls', server.handleRequest(this.getPolls))

    /**
     * Return a poll by id
     * @param {string} id
     */
    this.app.get('/polls/:id', server.handleRequest(this.getPoll))
  }
github decentraland / agora / src / Poll / Poll.router.ts View on Github external
mount() {
    /**
     * Returns all polls
     */
    this.app.get('/polls', server.handleRequest(this.getPolls))

    /**
     * Return a poll by id
     * @param {string} id
     */
    this.app.get('/polls/:id', server.handleRequest(this.getPoll))
  }
github decentraland / agora / src / Token / Token.router.ts View on Github external
mount() {
    /**
     * Returns all tokens
     */
    this.app.get('/tokens', server.handleRequest(this.getTokens))
  }
github decentraland / agora / src / Vote / Vote.router.ts View on Github external
mount() {
    /**
     * Returns a full vote by id
     */
    this.app.get('/votes/:id', server.handleRequest(this.getVote))

    /**
     * Returns the votes for a poll
     */
    this.app.get('/polls/:id/votes', server.handleRequest(this.getPollVotes))

    /**
     * Creates a new vote, returns the new id
     */
    this.app.post('/votes', server.handleRequest(this.createVote))
  }
github decentraland / agora / src / Receipt / Receipt.router.ts View on Github external
/**
     * Returns all receipts
     */
    this.app.get('/receipts', server.handleRequest(this.getReceipts))

    /**
     * Returns a receipt by id
     */
    this.app.get('/receipts/:id', server.handleRequest(this.getReceipt))

    /**
     * Returns account receipts
     */
    this.app.get(
      '/accounts/:address/receipts',
      server.handleRequest(this.getAccountReceipts)
    )
  }