Skip to content

Commit 73cdd81

Browse files
committed
- Updated .eslintrc.json - turned off new-cap
- Minor updates and syntax fixes for webserver.js
1 parent a00261d commit 73cdd81

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

boiler-plate/node-express-server/.eslintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
"ecmaVersion": "latest"
1313
},
1414
"rules": {
15+
"new-cap": "off"
1516
}
1617
}

boiler-plate/node-express-server/webserver.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const express = require('express');
22
const app = express();
33
const port = 3000;
44
// user-agents DOES NOT READ the actual userAgent string.
5-
// it just generates random fucking userAgent strings.
5+
// it just generates random userAgent strings.
66
let userAgent = require('user-agents');
77
const dir = '/user';
88

@@ -14,30 +14,30 @@ app.get('/', (req, res) => {
1414

1515
app.post('/', (req, res) => {
1616
res.send('Received a POST request to the API...');
17-
console.log(`Received POST request from port: ${port} to ${dir}userAgent:`)
17+
console.log(`Received POST request from port: ${port} to ${dir}userAgent:`);
1818
console.log(userAgent.toString());
19-
})
19+
});
2020

2121
app.put('/user', (req, res) => {
22-
res.send('Received a PUT request to the API...')
23-
console.log(`Received PUT request from port: ${port} to ${dir}userAgent:`)
22+
res.send('Received a PUT request to the API...');
23+
console.log(`Received PUT request from port: ${port} to ${dir}userAgent:`);
2424
console.log(userAgent.toString());
25-
})
25+
});
2626

2727
app.delete('/user', (req, res) => {
28-
res.send('Received a DELETE request to the API...')
29-
console.log(`Received DELETE request from port: ${port} to ${dir}userAgent:`)
28+
res.send('Received a DELETE request to the API...');
29+
console.log(`Received DELETE request from port: ${port} to ${dir}userAgent:`);
3030
console.log(userAgent.toString());
31-
})
31+
});
3232

3333
app.listen(port, () => {
34-
console.log(`Listening on port ${port}`)
35-
})
34+
console.log(`Listening on port ${port}`);
35+
});
3636

3737
app.use(() => {
38-
console.log(userAgent)
39-
})
38+
console.log(userAgent);
39+
});
4040

41-
//userAgentLogging
42-
userAgent = new userAgent();
43-
console.log(userAgent.toString());
41+
// userAgentLogging
42+
userAgent = new userAgent(); // eslint new-cap: "off"
43+
console.log(userAgent.toString()); // eslint new-cap: "off"

0 commit comments

Comments
 (0)