X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;f=node%2Fnode.bash;h=cac1272bca3cb08d2ca52abc448249c0474b1526;hb=77be4eb172eb0707be3f653189c10738e6090400;hp=33a9abb7e0e9061ef32828c8c8ace1f77e48318f;hpb=92f1fa8f894397669dc14675becd7c9eca9a4683;p=webi-installers%2F.git diff --git a/node/node.bash b/node/node.bash index 33a9abb..cac1272 100644 --- a/node/node.bash +++ b/node/node.bash @@ -5,6 +5,48 @@ # tagline: JavaScript V8 runtime # description: | # Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine +# examples: | +# ```bash +# node -e 'console.log("Hello, World!")' +# > Hello, World! +# ``` +#
+#
+# +# +# +# +# +# +#
Run a webserver

+#   mkdir my-server
+#   pushd my-server
+#   npm init
+#   npm install --save express
+#
+# app.js: +#
+#
'use strict'
+#   var express = require('express');
+#   var app = express();
+#   
+#   app.use('/', function (req, res, next) {
+#     res.end("Hello, World!");
+#   });
+#   
+#   module.exports = app;
+#
+# server.js: +#
+#
'use strict'
+#   var http = require('http');
+#   var app = require('./app.js');
+#   http.createServer(app).listen(8080, function () {
+#     console.log('Listening on', this.address());
+#   });
+#
+#
npm start
+#
set -e set -u