node.js - how run express js project on secure shell? -
1.please explain how create secure shell in express project?
var express = require('express'); var app = express(); var pg = require('pg'); app.listen(7207); var bodyparser = require('body-parser'); app.set('view engine', 'ejs'); app.use('/asset/css', express.static('asset/css')); var urlencodedparser = bodyparser.urlencoded({ extended:false }); app.get('/', function (req, res) { res.render('home'); }); console.log("server running on 7207 port........(192.168.1.29:7207)");
you can't create secure shell via node application. can run application in secure shell (ssh) following steps.
1) take terminal emulator , ssh machine command ssh user@ip_address
2) run application node_env="myenv" node myapp.js
you may create screen before running application application running if disconnect ssh session.
screen -s myscreen
create new screen.
Comments
Post a Comment