1 Star 0 Fork 125

[大天使长]/docsify

forked from docsifyjs/docsify 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
server.configs.js 1.30 KB
一键复制 编辑 原始数据 按行查看 历史
import * as path from 'node:path';
import * as url from 'node:url';
import { rewriteRules } from './middleware.js';
const __filename = url.fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
// Production (CDN URLs, watch disabled)
export const prodConfig = {
hostname: '127.0.0.1',
notify: false,
open: false,
port: 8080,
server: {
baseDir: './docs',
},
snippet: false,
ui: false,
};
// Development (local URLs, watch enabled)
export const devConfig = {
...prodConfig,
files: ['CHANGELOG.md', 'docs/**/*', 'lib/**/*'],
port: 3000,
rewriteRules,
server: {
...prodConfig.server,
routes: {
'/changelog.md': path.resolve(__dirname, 'CHANGELOG.md'),
'/lib': path.resolve(__dirname, 'lib'),
'/node_modules': path.resolve(__dirname, 'node_modules'), // Required for automated Vue tests
},
},
snippet: true,
};
// Test (local URLs, watch disabled)
export const testConfig = {
...devConfig,
port: 4000,
server: {
...devConfig.server,
middleware: [
// Blank page required for test environment
{
route: '/_blank.html',
handle(req, res, next) {
res.setHeader('Content-Type', 'text/html');
res.end('');
next();
},
},
],
},
snippet: false,
watch: false,
};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/yydick/docsify.git
git@gitee.com:yydick/docsify.git
yydick
docsify
docsify
develop

搜索帮助