mirror of
https://github.com/tenrok/axios.git
synced 2026-06-17 19:21:29 +03:00
chore(examples): fix module import (#6575)
This commit is contained in:
+3
-1
@@ -128,7 +128,9 @@ server = http.createServer(function (req, res) {
|
|||||||
// Process server request
|
// Process server request
|
||||||
else if (new RegExp('(' + dirs.join('|') + ')\/server').test(url)) {
|
else if (new RegExp('(' + dirs.join('|') + ')\/server').test(url)) {
|
||||||
if (fs.existsSync(path.join(__dirname, url + '.js'))) {
|
if (fs.existsSync(path.join(__dirname, url + '.js'))) {
|
||||||
require(path.join(__dirname, url + '.js'))(req, res);
|
import('./' + url + '.js').then(module => {
|
||||||
|
module.default(req, res)
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
send404(res);
|
send404(res);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user