Skip to content

Commit db54da5

Browse files
[mabel] Edit route parameter example to use arrow function
1 parent 47a9310 commit db54da5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

route_parameter_example_1.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
const express = require("express");
22
const app = express();
3+
const PORT = 3000;
34

4-
app.get("/users/:userId/books/:bookId", function(req, res) {
5+
app.get("/users/:userId/books/:bookId", (req, res) => {
56
res.send(req.params);
67
});
78

8-
const server = app.listen(3000, function() {
9-
console.log("Application started....");
9+
const server = app.listen(PORT, () => {
10+
console.log(`Server running at http://localhost:${PORT}`);
1011
});

0 commit comments

Comments
 (0)