mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-12 16:47:26 +02:00
Update server routing for "docs" urls
This commit is contained in:
parent
23f160f13a
commit
e3b99f800b
1 changed files with 4 additions and 1 deletions
|
@ -116,7 +116,7 @@ function execute(port) {
|
||||||
reloadMetadataCategories();
|
reloadMetadataCategories();
|
||||||
|
|
||||||
/* handle all requests for document pages */
|
/* handle all requests for document pages */
|
||||||
const app = express().get(/docs\/[\s\S]*html$/, (req, res) => {
|
const app = express().get(/docs\/[\s\S]*html$/, (req, res, next) => {
|
||||||
purgeCache(CWD + "/siteConfig.js");
|
purgeCache(CWD + "/siteConfig.js");
|
||||||
siteConfig = require(CWD + "/siteConfig.js");
|
siteConfig = require(CWD + "/siteConfig.js");
|
||||||
|
|
||||||
|
@ -138,6 +138,9 @@ function execute(port) {
|
||||||
|
|
||||||
let file = links[req.path.toString().replace(siteConfig.baseUrl, "")];
|
let file = links[req.path.toString().replace(siteConfig.baseUrl, "")];
|
||||||
file = CWD + "/../" + file;
|
file = CWD + "/../" + file;
|
||||||
|
if (!fs.existsSync(file)) {
|
||||||
|
next();
|
||||||
|
}
|
||||||
console.log(file);
|
console.log(file);
|
||||||
const result = readMetadata.processMetadata(file);
|
const result = readMetadata.processMetadata(file);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue