Skip to content

Commit 7fb2fd5

Browse files
committed
Use explicit check to deal with http://localhost:5000
1 parent 9e57f02 commit 7fb2fd5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

scripts/serve-dist.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ const http = require('http');
77
const handler = require('serve-handler');
88

99
const APP_ROOT = path.join(__dirname, '..');
10-
const options = { public: path.join(APP_ROOT, 'dist'), cleanUrls: true, };
10+
const options = { public: path.join(APP_ROOT, 'dist'), cleanUrls: false, };
1111

1212
const server = http.createServer((request, response) => {
1313
const urlObj = url.parse(request.url);
1414
return fs.access(path.join(APP_ROOT, 'dist', urlObj.pathname), fs.constants.F_OK, (error) => {
15-
if (!error) return handler(request, response, options);
15+
if (!error && urlObj.pathname !== '/') return handler(request, response, options);
1616
return handler(request, response, { rewrites: [{ source: '*', destination: '/index.html' }], ...options });
1717
});
1818
});

0 commit comments

Comments
 (0)