本文整理匯總了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,
示例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
示例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: {
示例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,
示例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
}
}
};