Deploy a LoopBack API project using now.sh

InstructorBram Borggreve

Share this video with your friends

Send Tweet

In this lesson we will look at how to deploy our LoopBack API project using now.

We will install the now client, create an account and deploy our app.

Using now secrets features we will store our database connection url which we get by creating a free MongoDB Atlas database.

In order to simplify following deployments we will add a now key to our package.json where we use the name, alias and env parameters to configure our deployments. We will add some npm scripts so we can deploy our app in the desired way using npm run now.

Cristian Caroli
~ 7 years ago

For some reason the string connection doesn't work properly when you add it as a secret (it's identical as the one you pass it on the video, with personal password, of course)

´´´

Connection fails: MongoError: connection 3 to cluster0-shard-00-00-dkrpm.mongodb.net:27017 closed It will be retried for the next request. /home/nowuser/src/node_modules/bluebird/js/release/async.js:61 fn = function () { throw arg; }; ^ MongoError: connection 3 to cluster0-shard-00-00-dkrpm.mongodb.net:27017 closed at Function.MongoError.create (/home/nowuser/src/node_modules/mongodb-core/lib/error.js:29:11) ´´´

Victor Hazbun
~ 7 years ago

@cristian_caroli did you resolved the issue already?

aryyya
~ 5 years ago

now.sh doesn't operate like this lesson suggests anymore.