本文整理汇总了TypeScript中connect-history-api-fallback/lib.lib函数的典型用法代码示例。如果您正苦于以下问题:TypeScript lib函数的具体用法?TypeScript lib怎么用?TypeScript lib使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了lib函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: browserSync
done => {
browserSync({
online: false,
open: false,
port: 9000,
server: {
baseDir: ['.'],
middleware: [historyApiFallback(), function(req, res, next) {
res.setHeader('Access-Control-Allow-Origin', '*');
next();
}]
}
}, done);
}
示例2: browserSync
done => {
browserSync({
online: false,
open: false,
port: 9000,
logLevel: 'silent',
server: {
baseDir: ['.'],
middleware: [historyApiFallback(), function(req, res, next) {
res.setHeader('Access-Control-Allow-Origin', '*');
next();
}]
}
}, function (err, bs) {
let urls = bs.options.get('urls').toJS();
console.log(`Application Available At: ${urls.local}`);
console.log(`BrowserSync Available At: ${urls.ui}`);
done();
});
}
示例3: browserSync
done => {
browserSync({
online: false,
open: CLIOptions.hasFlag('open'),
port: 9000,
logLevel: 'silent',
server: {
baseDir: [project.platform.baseDir],
middleware: [historyApiFallback(), function(req, res, next) {
res.setHeader('Access-Control-Allow-Origin', '*');
next();
}]
}
}, function (err, bs) {
if (err) return done(err);
let urls = bs.options.get('urls').toJS();
log(`Application Available At: ${urls.local}`);
log(`BrowserSync Available At: ${urls.ui}`);
done();
});
}