Why is it wrong to throw er; // Unhandled 'error' event?
-
When the server's work is checked, there's a mistake, why?
Code itself
const http = require('http'); const PORT = 3000;
const server = http.createServer((req, res) => {
console.log('Server request');
});server.listen(PORT, 'localshost', (error) => {
error ? console.log(error) : console.log('listening port ${PORT}');
});
-
You have a seal:
localshost
insteadlocalhost
Names
localshost
The computer doesn't know.