August 2018
Intermediate to advanced
410 pages
9h 18m
English
Let's develop some code. Create a directory called mynode and, in this directory, create a file called mynode.js with the following code:
var http = require('http');var server = http.createServer(function(req, res) {res.writeHead(200);res.end('Hi all!');});server.listen(8080);
This is a simple web server that serves a page saying Hi All! We're in the very early stage of our development process. To create a package.json, execute the following:
npm init
And fill up the information:
name: (mynode)version: (1.0.0) 0.0.1description: My first Node Appentry point: (mynode.js)test command: node mynode.jsgit repository:keywords: webappauthor: John Doelicense: (ISC)
Now we are ready to execute Draft:
draft create
This will create a Dockerfile ...
Read now
Unlock full access