We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
instead of this bit
else if (url === '/main.css') { res.writeHead(200, {'Content-Type' : 'text/css'}); res.end(indexStyle); } else if (url === '/main.js') { res.writeHead(200, {'Content-Type' : 'text/js'}); res.end(indexJS); } else if (url === '/cookie.js') { res.writeHead(200, {'Content-Type' : 'text/js'}); res.end(cookieJS);
you could just use something like this:
else { fs.readFile(__dirname + '/public' + req.url, function(err, file) { if (err) { res.writeHead(404); res.end('arm broken'); } else { var ext = req.url.split('.')[1]; res.writeHead(200, { 'Content-Type': 'text/' + ext }); res.end(file); } }); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
instead of this bit
you could just use something like this:
The text was updated successfully, but these errors were encountered: