← helloexpress

send html string to browser

e7c4c2fc920f50dbf6d5672bd604e19b7529c557 · ovidiucs · Apr 16, 2014 03:43

+10 · 1 file changed

  • app.js +10 −0
diff --git a/app.js b/app.js
index 5eeb47b..15bc1bf 100644
--- a/app.js
+++ b/app.js
@@ -14,6 +14,16 @@ app.set('port', process.env.PORT || 3000);
 app.get('/', function(req,res) {
 	res.send("Hello, Express!");
 
+	});
+
+app.get('/hi', function(req,res) {
+// send more than text
+	var message = [
+			'<ul><li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li>',
+			'<li>Aliquam tincidunt mauris eu risus.</li>',
+			'<li>Vestibulum auctor dapibusneque.</li></ul>'].join("\n");
+	res.send(message);
+
 	});
 // post
 // create data