← helloexpress

route variables

cce5a5b0daa8da89e93396699420128a4639d04e · ovidiucs · Apr 16, 2014 03:50

+6 · 1 file changed

  • app.js +6 −0
diff --git a/app.js b/app.js
index 15bc1bf..daa37df 100644
--- a/app.js
+++ b/app.js
@@ -25,6 +25,12 @@ app.get('/hi', function(req,res) {
 	res.send(message);
 
 	});
+
+app.get('/users/:userId', function(req,res) {
+	res.send("<h2>Hello, User #" + req.params.userId + "!");
+	
+	});
+
 // post
 // create data