mirror of
https://github.com/tenrok/axios.git
synced 2026-06-05 16:42:32 +03:00
fix(examples): application crashed when navigating examples in browser (#5938)
fix(examples): application crashed when navigating examples in browser (#5938)
This commit is contained in:
+2
-2
@@ -128,8 +128,8 @@ server = http.createServer(function (req, res) {
|
||||
// Process server request
|
||||
else if (new RegExp('(' + dirs.join('|') + ')\/server').test(url)) {
|
||||
if (fs.existsSync(path.join(__dirname, url + '.js'))) {
|
||||
import('./' + url + '.js').then(module => {
|
||||
module.default(req, res)
|
||||
import('file://' + path.join(__dirname, url + '.js')).then((server) => {
|
||||
server.default(req, res);
|
||||
});
|
||||
} else {
|
||||
send404(res);
|
||||
|
||||
Reference in New Issue
Block a user