mirror of
https://github.com/axios/axios.git
synced 2026-04-11 02:11:50 +08:00
chore(examples): fix module import (#6575)
This commit is contained in:
parent
df9889b83c
commit
bc03c6cbc4
@ -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);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user