We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent df9889b commit bc03c6cCopy full SHA for bc03c6c
examples/server.js
@@ -128,7 +128,9 @@ server = http.createServer(function (req, res) {
128
// Process server request
129
else if (new RegExp('(' + dirs.join('|') + ')\/server').test(url)) {
130
if (fs.existsSync(path.join(__dirname, url + '.js'))) {
131
- require(path.join(__dirname, url + '.js'))(req, res);
+ import('./' + url + '.js').then(module => {
132
+ module.default(req, res)
133
+ });
134
} else {
135
send404(res);
136
}
0 commit comments