Skip to content

Commit

Permalink
chore(examples): fix module import (#6575)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuroino721 committed Aug 30, 2024
1 parent df9889b commit bc03c6c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit bc03c6c

Please sign in to comment.