1.0.1 • Published 5 years ago

az-js-server v1.0.1

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

AZ

Execution: from myaz directory run:

sudo node ../AZ/server /home/ubuntu/AZPapa/myaz/config.js

running as Docler:

building: sudo sudo docker build -t azjs/v1 .

sudo docker run -d -p 80:80 --v :

for example:

//dest should always be myaz because this is how the run command works

example with -v: sudo docker run -it -p 80:80 -v /home/ubuntu/AZPapa/myaz:/myaz fa3c76f7095f

You can use the hoset network if U want, this way AZ is just a proxy to the host: sudo docker run -it -p --network host -v /home/ubuntu/AZPapa/myaz:/myaz azjs/v1
EX: ubuntu@ip-172-31-47-109:~/AZPapa/AZ$ sudo docker run -d --network host -v /home/ubuntu/AZPapa/myaz:/myaz azjs/v1

U can run with HTTPS: sudo docker run -p 443:443 -it -v /home/ubuntu/azPapa/myaz:/myaz orenzbeda/azjs

also in this case you config.js should relate to /myaz and not to /home/ubuntu/AZPapa/myaz

you will need a file MySessionManagment.js to tell the server how to manage your sessions. an example for a file:

//plase user resave false or U will overun the remote server

// let redis = require("redis"); // let client = redis.createClient();

 let session = require('express-session');

// let RedisStore = require('connect-redis')(session);

//  let mySession = session({
// 	    store: new RedisStore({ host: 'localhost', port: 6379, client: client}),
// 	    key: "session.sid",
// 	    secret:'keyboard cat zzz',
// 	    resave: false,
// 	     saveUninitialized: true
// 		})



let mySession =  session({
  secret: 'keyboard cat',
  resave: false,
  saveUninitialized: true,
  cookie: { secure: true }
})		
module.exports = mySession;

You can use dockerCompuse yml example file and run the redis example.