mirror of
https://github.com/tenrok/axios.git
synced 2026-05-15 11:59:42 +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
|
||||
else if (new RegExp('(' + dirs.join('|') + ')\/server').test(url)) {
|
||||
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 {
|
||||
send404(res);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user