{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "#https://www.tutorialspoint.com/nodejs/nodejs_first_application.htm\n", "var http = require(\"http\");\n", "\n", "http.createServer(function (request, response) {\n", "\n", " // Send the HTTP header \n", " // HTTP Status: 200 : OK\n", " // Content Type: text/plain\n", " response.writeHead(200, {'Content-Type': 'text/plain'});\n", " \n", " // Send the response body as \"Hello World\"\n", " response.end('Hello World\\n');\n", "}).listen(8081);\n", "\n", "// Console will print the message\n", "console.log('Server running at http://127.0.0.1:8081/');" ] } ], "metadata": { "kernelspec": { "display_name": "Bash", "language": "bash", "name": "bash" }, "language_info": { "codemirror_mode": "shell", "file_extension": ".sh", "mimetype": "text/x-sh", "name": "bash" } }, "nbformat": 4, "nbformat_minor": 0 }