keystonejs/keystone-classic

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

Open

#4,950 opened on Jul 30, 2019

View on GitHub
 (1 comment) (0 reactions) (0 assignees)JavaScript (2,288 forks)batch import
help wantedquestion

Repository metrics

Stars
 (14,656 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

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

  • Remote server has appropriate versions of Node.js & npm installed (ideally the same as what you have been testing with in development)

  • Check out (or copy) the latest version of your application source to the remote server.

  • Run npm install (or npm install --production if this will be a production environment) in the top-level of your application source directory.

#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

Contributor guide