keystonejs / keystone-classic

Node.js CMS and web app framework
http://v4.keystonejs.com
MIT License
14.65k stars 2.21k forks source link

How to configure settings in keystone js on deploying on a Linux server ? #4950

Open Rajivkumar1234 opened 4 years ago

Rajivkumar1234 commented 4 years ago

I am developing an app and I want to deploy it on a linux server. I already have copy my local files to the server . I have read this article but not so clear to me https://github.com/keystonejs/keystone/issues/4687.

Question 1: How i am going to set mongo database on production on the server? Question 2 : What are other configuration i do need to set up to complete the deployment and be able to run the node js app ? Question 3 : What would be the mongo configuration i need to do on the server?

Questiom 4: where do i am going to set this MONGO_URI ? and what does this means ?

Things I have done

my keystone js settings

keystone.init({
    'name': 'TestApp',
    'brand': 'TestApp',
    'sass': 'public',
    'static': 'public',
    'favicon': 'public/favicon.ico',
    'auto update': true,
    'views': 'templates/views',
    'view engine': '.html',
    'custom engine': cons.nunjucks,
    'mongo': process.env.MONGO_URI || process.env.MONGOLAB_URI || 'mongodb://localhost/testdatabse',
    'auto update': true,
    'emails': 'templates/email',
    'session': true,
    'auth': true,
    'user model': 'User',
});

.env

NODE_ENV=production @autoboxer

scipe commented 4 years ago

@Rajivkumar1234 hi! All your questions more relative to mongodb. Just install it from mongodb web site. MONGO_URI just link on your mongo db. For example: mongodb://user:password@host/database