We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0c8d5f2 commit 2f4c3beCopy full SHA for 2f4c3be
scripts/dev.js
@@ -5,6 +5,16 @@ const fs = require('fs-extra');
5
const app = express();
6
const root = './build';
7
8
+// redirects for / root
9
+app.use((req, res, next) => {
10
+ if (req.path === '/') {
11
+ // eslint-disable-next-line no-console
12
+ console.log('[REDIRECT]', `from [${req.path}]`, `to [/docs]`);
13
+ return res.redirect(301, '/docs');
14
+ }
15
+ return next();
16
+});
17
+
18
// redirect from /folder to /folder/ if it is directory
19
app.use(async (req, res, next) => {
20
const reqPath = decodeURIComponent(req.path);
0 commit comments