Skip to content

Commit a7e6b43

Browse files
Dan WahlinDan Wahlin
Dan Wahlin
authored and
Dan Wahlin
committed
More cleanup
1 parent 98f7808 commit a7e6b43

File tree

6 files changed

+36
-36
lines changed

6 files changed

+36
-36
lines changed

modules/module2/files/beginFiles/server.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ class Server {
5252
app.use(cookieParser());
5353
app.use(csrf({ cookie: true }));
5454

55-
app.use(function (req, res, next) {
55+
app.use((req, res, next) => {
5656
var csrfToken = req.csrfToken();
5757
res.locals._csrf = csrfToken;
5858
res.cookie('XSRF-TOKEN', csrfToken);
5959
next();
6060
});
6161

62-
process.on('uncaughtException', function (err) {
62+
process.on('uncaughtException', (err) => {
6363
if (err) console.log(err, err.stack);
6464
});
6565
}
@@ -69,20 +69,20 @@ class Server {
6969
require("readline").createInterface({
7070
input: process.stdin,
7171
output: process.stdout
72-
}).on("SIGINT", function () {
72+
}).on("SIGINT", () => {
7373
console.log('SIGINT: Closing MongoDB connection');
7474
database.close();
7575
});
7676
}
7777

78-
process.on('SIGINT', function() {
78+
process.on('SIGINT', () => {
7979
console.log('SIGINT: Closing MongoDB connection');
8080
database.close();
8181
});
8282
}
8383

8484
initDbSeeder() {
85-
database.open(function() {
85+
database.open(() => {
8686
//Set NODE_ENV to 'development' and uncomment the following if to only run
8787
//the seeder when in dev mode
8888
//if (process.env.NODE_ENV === 'development') {
@@ -96,7 +96,7 @@ class Server {
9696

9797

9898
// redirect all others to the index (HTML5 history)
99-
app.all('/*', function(req, res) {
99+
app.all('/*', (req, res) => {
100100
res.sendFile(__dirname + '/public/index.html');
101101
});
102102
}

modules/module3/files/beginFiles/server.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ class Server {
5252
app.use(cookieParser());
5353
//app.use(csrf({ cookie: true }));
5454

55-
//app.use(function (req, res, next) {
55+
//app.use((req, res, next) => {
5656
// var csrfToken = req.csrfToken();
5757
// res.locals._csrf = csrfToken;
5858
// res.cookie('XSRF-TOKEN', csrfToken);
5959
// next();
6060
//});
6161

62-
process.on('uncaughtException', function (err) {
62+
process.on('uncaughtException', (err) => {
6363
if (err) console.log(err, err.stack);
6464
});
6565
}
@@ -69,20 +69,20 @@ class Server {
6969
require("readline").createInterface({
7070
input: process.stdin,
7171
output: process.stdout
72-
}).on("SIGINT", function () {
72+
}).on("SIGINT", () => {
7373
console.log('SIGINT: Closing MongoDB connection');
7474
database.close();
7575
});
7676
}
7777

78-
process.on('SIGINT', function() {
78+
process.on('SIGINT', () => {
7979
console.log('SIGINT: Closing MongoDB connection');
8080
database.close();
8181
});
8282
}
8383

8484
initDbSeeder() {
85-
database.open(function() {
85+
database.open(() => {
8686
//Set NODE_ENV to 'development' and uncomment the following if to only run
8787
//the seeder when in dev mode
8888
//if (process.env.NODE_ENV === 'development') {
@@ -96,7 +96,7 @@ class Server {
9696
router.load(app, './controllers');
9797

9898
// redirect all others to the index (HTML5 history)
99-
app.all('/*', function(req, res) {
99+
app.all('/*', (req, res) => {
100100
res.sendFile(__dirname + '/public/index.html');
101101
});
102102
}

modules/module4/files/beginFiles/server.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ class Server {
5252
app.use(cookieParser());
5353
//app.use(csrf({ cookie: true }));
5454

55-
//app.use(function (req, res, next) {
55+
//app.use((req, res, next) => {
5656
// var csrfToken = req.csrfToken();
5757
// res.locals._csrf = csrfToken;
5858
// res.cookie('XSRF-TOKEN', csrfToken);
5959
// next();
6060
//});
6161

62-
process.on('uncaughtException', function (err) {
62+
process.on('uncaughtException', (err) => {
6363
if (err) console.log(err, err.stack);
6464
});
6565
}
@@ -69,20 +69,20 @@ class Server {
6969
require("readline").createInterface({
7070
input: process.stdin,
7171
output: process.stdout
72-
}).on("SIGINT", function () {
72+
}).on("SIGINT", () => {
7373
console.log('SIGINT: Closing MongoDB connection');
7474
database.close();
7575
});
7676
}
7777

78-
process.on('SIGINT', function() {
78+
process.on('SIGINT', () => {
7979
console.log('SIGINT: Closing MongoDB connection');
8080
database.close();
8181
});
8282
}
8383

8484
initDbSeeder() {
85-
database.open(function() {
85+
database.open(() => {
8686
//Set NODE_ENV to 'development' and uncomment the following if to only run
8787
//the seeder when in dev mode
8888
//if (process.env.NODE_ENV === 'development') {
@@ -96,7 +96,7 @@ class Server {
9696
router.load(app, './controllers');
9797

9898
// redirect all others to the index (HTML5 history)
99-
app.all('/*', function(req, res) {
99+
app.all('/*', (req, res) => {
100100
res.sendFile(__dirname + '/public/index.html');
101101
});
102102
}

modules/module5/files/beginFiles/server.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ class Server {
5252
app.use(cookieParser());
5353
//app.use(csrf({ cookie: true }));
5454

55-
//app.use(function (req, res, next) {
55+
//app.use((req, res, next) => {
5656
// var csrfToken = req.csrfToken();
5757
// res.locals._csrf = csrfToken;
5858
// res.cookie('XSRF-TOKEN', csrfToken);
5959
// next();
6060
//});
6161

62-
process.on('uncaughtException', function (err) {
62+
process.on('uncaughtException', (err) => {
6363
if (err) console.log(err, err.stack);
6464
});
6565
}
@@ -69,20 +69,20 @@ class Server {
6969
require("readline").createInterface({
7070
input: process.stdin,
7171
output: process.stdout
72-
}).on("SIGINT", function () {
72+
}).on("SIGINT", () => {
7373
console.log('SIGINT: Closing MongoDB connection');
7474
database.close();
7575
});
7676
}
7777

78-
process.on('SIGINT', function() {
78+
process.on('SIGINT', () => {
7979
console.log('SIGINT: Closing MongoDB connection');
8080
database.close();
8181
});
8282
}
8383

8484
initDbSeeder() {
85-
database.open(function() {
85+
database.open(() => {
8686
//Set NODE_ENV to 'development' and uncomment the following if to only run
8787
//the seeder when in dev mode
8888
//if (process.env.NODE_ENV === 'development') {
@@ -96,7 +96,7 @@ class Server {
9696
router.load(app, './controllers');
9797

9898
// redirect all others to the index (HTML5 history)
99-
app.all('/*', function(req, res) {
99+
app.all('/*', (req, res) => {
100100
res.sendFile(__dirname + '/public/index.html');
101101
});
102102
}

modules/module6/files/beginFiles/server.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ class Server {
5252
app.use(cookieParser());
5353
//app.use(csrf({ cookie: true }));
5454

55-
//app.use(function (req, res, next) {
55+
//app.use((req, res, next) => {
5656
// var csrfToken = req.csrfToken();
5757
// res.locals._csrf = csrfToken;
5858
// res.cookie('XSRF-TOKEN', csrfToken);
5959
// next();
6060
//});
6161

62-
process.on('uncaughtException', function (err) {
62+
process.on('uncaughtException', (err) => {
6363
if (err) console.log(err, err.stack);
6464
});
6565
}
@@ -69,20 +69,20 @@ class Server {
6969
require("readline").createInterface({
7070
input: process.stdin,
7171
output: process.stdout
72-
}).on("SIGINT", function () {
72+
}).on("SIGINT", () => {
7373
console.log('SIGINT: Closing MongoDB connection');
7474
database.close();
7575
});
7676
}
7777

78-
process.on('SIGINT', function() {
78+
process.on('SIGINT', () => {
7979
console.log('SIGINT: Closing MongoDB connection');
8080
database.close();
8181
});
8282
}
8383

8484
initDbSeeder() {
85-
database.open(function() {
85+
database.open(() => {
8686
//Set NODE_ENV to 'development' and uncomment the following if to only run
8787
//the seeder when in dev mode
8888
//if (process.env.NODE_ENV === 'development') {
@@ -96,7 +96,7 @@ class Server {
9696
router.load(app, './controllers');
9797

9898
// redirect all others to the index (HTML5 history)
99-
app.all('/*', function(req, res) {
99+
app.all('/*', (req, res) => {
100100
res.sendFile(__dirname + '/public/index.html');
101101
});
102102
}

modules/module7/files/beginFiles/server.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ class Server {
5252
app.use(cookieParser());
5353
//app.use(csrf({ cookie: true }));
5454

55-
//app.use(function (req, res, next) {
55+
//app.use((req, res, next) => {
5656
// var csrfToken = req.csrfToken();
5757
// res.locals._csrf = csrfToken;
5858
// res.cookie('XSRF-TOKEN', csrfToken);
5959
// next();
6060
//});
6161

62-
process.on('uncaughtException', function (err) {
62+
process.on('uncaughtException', (err) => {
6363
if (err) console.log(err, err.stack);
6464
});
6565
}
@@ -69,20 +69,20 @@ class Server {
6969
require("readline").createInterface({
7070
input: process.stdin,
7171
output: process.stdout
72-
}).on("SIGINT", function () {
72+
}).on("SIGINT", () => {
7373
console.log('SIGINT: Closing MongoDB connection');
7474
database.close();
7575
});
7676
}
7777

78-
process.on('SIGINT', function() {
78+
process.on('SIGINT', () => {
7979
console.log('SIGINT: Closing MongoDB connection');
8080
database.close();
8181
});
8282
}
8383

8484
initDbSeeder() {
85-
database.open(function() {
85+
database.open(() => {
8686
//Set NODE_ENV to 'development' and uncomment the following if to only run
8787
//the seeder when in dev mode
8888
//if (process.env.NODE_ENV === 'development') {
@@ -96,7 +96,7 @@ class Server {
9696
router.load(app, './controllers');
9797

9898
// redirect all others to the index (HTML5 history)
99-
app.all('/*', function(req, res) {
99+
app.all('/*', (req, res) => {
100100
res.sendFile(__dirname + '/public/index.html');
101101
});
102102
}

0 commit comments

Comments
 (0)