How to use the egg.env function in egg

To help you get started, we’ve selected a few egg 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 wechatpivot / wechatpivot / mockup / app / controller / pivot.js View on Github external
async oauth() {
      const { ctx, config } = this;
      const env = config.props['egg.env'];
      const { code, r } = ctx.queries;

      if (!r) {
        throw new Error('INVALID R');
      }

      if (!code) {
        throw new Error('INVALID CODE');
      }

      // await ctx.service.oauth.getAccessToken(code);

      let redirect = r;
      if (r.indexOf('?') > -1) {
        redirect += '&code=' + code;
      } else {
github wechatpivot / wechatpivot / mockup / app / controller / view.js View on Github external
async debugger() {
      const { ctx, config } = this;
      await ctx.render('debugger.html', { env: config.props['egg.env'] });
    }
  }