當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript tools.env函數代碼示例

本文整理匯總了TypeScript中@toba/tools.env函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript env函數的具體用法?TypeScript env怎麽用?TypeScript env使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了env函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: env

import { env } from '@toba/tools';
import { OwnerConfig, SiteConfig } from '@trailimage/models';

/** Site domain name. */
export const domain = 'trailimage.com';

const url = `http://www.${domain}`;

export const owner: OwnerConfig = {
   name: 'Jason Abbott',
   image: {
      url: url + '/img/face4_300px.jpg',
      width: 300,
      height: 300
   },
   email: env('EMAIL_CONTACT', null),
   urls: [
      'https://www.facebook.com/jason.e.abbott',
      'http://www.flickr.com/photos/boise',
      'https://www.youtube.com/user/trailimage',
      'https://twitter.com/trailimage'
   ]
};

export const site: SiteConfig = {
   domain,
   title: 'Trail Image',
   subtitle: 'Adventure Photography by ' + owner.name,
   description:
      'Stories, images and videos of small adventure trips in and around the state of Idaho',
   url,
開發者ID:Trail-Image,項目名稱:blog,代碼行數:31,代碼來源:models.ts

示例2: env

   /**
    * Characters separating title and subtitle in library source. Posts with
    * different subtitles but the same title are considered parts of a series
    */
   subtitleSeparator: ':',
   /** Photo EXIF is only shown for named artists */
   artistNames: ['Abbott', 'Wright', 'Bowman', 'Thomas', 'Reed'],
   /** Key (slug) of root category to display on home page */
   defaultCategory: 'when'
};

export const config = {
   env,
   domain,
   /** Whether to redirect `HTTP` requests to `HTTPS`. */
   requireSSL: env('REQUIRE_SSL', '') == 'true',

   /** Whether any provider needs authorization tokens */
   //    get needsAuth(): boolean {
   //       const f = flickr.auth.token.access;
   //       const g = google.auth.token.access;
   //       return f === null || f === '' || g === null || g === '';
   //    },
   proxy: env('HTTPS_PROXY', null),

   /** When the application started. Used for cache busting. */
   timestamp: new Date().getTime(),

   /**
    * Whether site is running tests. This is only needed in a few particular
    * cases, such as setting the `isProduction` flag while using response
開發者ID:Trail-Image,項目名稱:blog,代碼行數:31,代碼來源:index.ts

示例3: env

import { env } from '@toba/tools';
import { mapSource } from './mapsource';

export const bing = {
   key: env('BING_KEY', null)
};

/**
 * https://developers.facebook.com/docs/reference/plugins/like/
 * https://developers.facebook.com/apps/110860435668134/summary
 */
export const facebook = {
   appID: '599065673763481',
   pageID: '241863632579825',
   siteID: '578261855525416',
   adminID: '1332883594',
   enabled: true,
   authorURL: 'https://www.facebook.com/jason.e.abbott'
};

export const google = {
   apiKey: env('GOOGLE_KEY', null),
   projectID: '316480757902',
   analyticsID: '22180727', // shown as 'UA-22180727-1
   searchEngineID: env('GOOGLE_SEARCH_ID', null),
   blogID: '118459106898417641'
};

export const mapbox = {
   accessToken: env('MAPBOX_ACCESS_TOKEN'),
   style: {
開發者ID:Trail-Image,項目名稱:blog,代碼行數:31,代碼來源:vendors.ts

示例4: env

import { env } from '@toba/tools';
import { Token } from '@toba/oauth';
import { ProviderConfig } from '@trailimage/google-provider';
import { domain } from './models';
import { mapSource } from './mapsource';

/**
 * @see http://code.google.com/apis/console/#project:1033232213688
 */
export const mapProvider: ProviderConfig = {
   api: {
      apiKey: env('GOOGLE_DRIVE_KEY'),
      folderID: '0B0lgcM9JCuSbMWluNjE4LVJtZWM',
      cacheSize: 0,
      useCache: false,
      auth: {
         apiKey: '',
         clientID: env('GOOGLE_CLIENT_ID'),
         secret: env('GOOGLE_SECRET'),
         callback: 'http://www.' + domain + '/auth/google',
         token: {
            type: null,
            access: env('GOOGLE_ACCESS_TOKEN', null),
            accessExpiration: null as Date,
            refresh: env('GOOGLE_REFRESH_TOKEN')
         } as Token
      }
   },
   minimumTrackLength: 0.2,
   minimumTrackPoints: 5,
   maxPointDeviationFeet: 0.5,
開發者ID:Trail-Image,項目名稱:blog,代碼行數:31,代碼來源:map-provider.ts

示例5: env

   api: {
      userID: '60950751@N04',
      appID: '72157631007435048',
      timeZoneOffset: -7,
      searchPhotoSizes: [Flickr.SizeCode.Square150],
      // setPhotoSizes will be copied from provider configuration
      excludeSets: ['72157631638576162'],
      excludeTags: [
         'Idaho',
         'United States of America',
         'Abbott',
         'LensTagger',
         'Boise'
      ],
      maxRetries: 10,
      retryDelay: 300,
      useCache: true,
      maxCacheSize: 500,
      auth: {
         apiKey: env('FLICKR_API_KEY'),
         secret: env('FLICKR_SECRET'),
         callback: 'http://www.' + domain + '/auth/flickr',
         token: {
            access: env('FLICKR_ACCESS_TOKEN', null),
            secret: env('FLICKR_TOKEN_SECRET', null),
            request: null as string
         } as Token
      }
   }
};
開發者ID:Trail-Image,項目名稱:blog,代碼行數:30,代碼來源:post-provider.ts


注:本文中的@toba/tools.env函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。