command to start node project code example
Example 1: serve build node npm
# in terminal cd to project root dir
# to build project:
npm run build
# to serve/host project locally:
serve -s ./build
Example 2: how to use http in development mode for nodejs
var fs = require("fs"),
http = require("https");
var privateKey = fs.readFileSync('sslcert/server.key').toString();
var certificate = fs.readFileSync('sslcert/server.crt').toString();
var credentials = {key: privateKey, cert: certificate};
var server = http.createServer(credentials,function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
});
server.listen(8000);