mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-12 08:37:25 +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();
|
||||
|
||||
/* 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");
|
||||
siteConfig = require(CWD + "/siteConfig.js");
|
||||
|
||||
|
@ -138,6 +138,9 @@ function execute(port) {
|
|||
|
||||
let file = links[req.path.toString().replace(siteConfig.baseUrl, "")];
|
||||
file = CWD + "/../" + file;
|
||||
if (!fs.existsSync(file)) {
|
||||
next();
|
||||
}
|
||||
console.log(file);
|
||||
const result = readMetadata.processMetadata(file);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue