diff --git a/lib/server/server.js b/lib/server/server.js index eb73f9a603..4d4787fe4e 100644 --- a/lib/server/server.js +++ b/lib/server/server.js @@ -140,6 +140,7 @@ function execute(port) { file = CWD + "/../" + file; if (!fs.existsSync(file)) { next(); + return; } console.log(file); const result = readMetadata.processMetadata(file); @@ -253,7 +254,7 @@ function execute(port) { }); /* handle all other main pages */ - app.get("*.html", (req, res) => { + app.get("*.html", (req, res, next) => { purgeCache(CWD + "/siteConfig.js"); siteConfig = require(CWD + "/siteConfig.js"); @@ -337,7 +338,8 @@ function execute(port) { res.send(str); } else { console.log(req.path); - res.send("No file found"); + next(); + return; } }); @@ -377,6 +379,8 @@ function execute(port) { /* serve static content first from user folder then from docusaurus */ app.use(siteConfig.baseUrl, express.static(CWD + "/static")); app.use(siteConfig.baseUrl, express.static(__dirname + "/../static")); + app.use(express.static(CWD + "/static")); + app.use(express.static(__dirname + "/../static")); app.get(/\/[^\.]*\/?$/, (req, res) => { if (req.path.toString().endsWith("/")) { diff --git a/package.json b/package.json index 47587493ed..50adb11c61 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "shelljs": "^0.7.8" }, "name": "docusaurus", - "version": "1.0.0-alpha.19", + "version": "1.0.0-alpha.20", "bin": { "docusaurus-start": "./lib/start-server.js", "docusaurus-build": "./lib/build-files.js",