本文整理汇总了TypeScript中@trailimage/models.blog.load方法的典型用法代码示例。如果您正苦于以下问题:TypeScript blog.load方法的具体用法?TypeScript blog.load怎么用?TypeScript blog.load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@trailimage/models.blog
的用法示例。
在下文中一共展示了blog.load方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: loadMockData
export function loadMockData() {
postProvider.configure(config.providers.post);
mapProvider.configure(config.providers.map);
modelConfig.owner = config.owner;
modelConfig.subtitleSeparator = config.posts.subtitleSeparator;
modelConfig.maxPhotoMarkersOnMap = config.providers.map.maxMarkers;
modelConfig.providers.post = postProvider;
modelConfig.providers.map = mapProvider;
modelConfig.site = config.site;
return blog.load();
}
示例2: createWebService
async function createWebService() {
const app = Express();
const port = process.env['PORT'] || 3000;
log.info(
`Starting ${
config.isProduction ? 'production' : 'development'
} application`
);
defineViews(app);
if (false) {
//config.needsAuth) {
// must authenticate before normal routes are available
route.authentication(app);
app.listen(port);
log.info(`Listening for authentication on port ${port}`);
} else {
if (config.requireSSL) {
app.use(requireSSL);
}
app.use(blockSpamReferers);
// https://github.com/expressjs/compression/blob/master/README.md
app.use(compress());
app.use(Express.static(path.join(root, 'public')));
await blog.load();
if (blog.loaded) {
// blog must be loaded before routes are defined
route.standard(app);
app.listen(port);
log.info(`Listening on port ${port}`);
} else {
log.error('Blog data failed to load. Stopping application.');
}
}
}