Uh oh!
There was an error while loading. Please reload this page.
forked from docsifyjs/docsify
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.configs.js
More file actions
Latest commit
61 lines (57 loc) Β· 1.41 KB
/
Copy pathserver.configs.js
File metadata and controls
61 lines (57 loc) Β· 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import*aspathfrom'node:path';
import*asurlfrom'node:url';
import{rewriteRules}from'./middleware.js';
const__filename=url.fileURLToPath(import.meta.url);
const__dirname=path.dirname(__filename);
// Production (CDN URLs, watch disabled)
exportconstprodConfig={
ghostMode: false,
hostname: '127.0.0.1',
notify: false,
open: false,
port: 8080,
server: {
baseDir: './docs',
},
snippet: false,
ui: false,
};
// Development (local URLs, watch enabled)
exportconstdevConfig={
...prodConfig,
files: ['CHANGELOG.md','docs/**/*','dist/**/*'],
port: 3000,
rewriteRules,
reloadDebounce: 1000,
reloadOnRestart: true,
server: {
...prodConfig.server,
routes: {
'/changelog.md': path.resolve(__dirname,'CHANGELOG.md'),
'/dist': path.resolve(__dirname,'dist'),
'/node_modules': path.resolve(__dirname,'node_modules'),// Required for automated Vue tests
},
},
snippet: true,
};
// Test (local URLs, watch disabled)
exportconsttestConfig={
...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('<!DOCTYPE html><html><body></body></html>');
next();
},
},
],
},
snippet: false,
watch: false,
};