How to use Meteor settings.json when deploying to Heroku? [duplicate] - meteor

This is probably a very basic question, but this is my first time using Meteor + Heroku and I can't seem to figure out how to use the settings.json file after deploying a Meteor app (currently using heroku).
From my hours of research on web, it seems that in order to use the settings in a deployed app, I have to do...
export METEOR_SETTINGS="$(cat settings.json)"
At first I thought that this is meant to go to a boostrap file... Then I realized I was wrong when I started get reserved word errors (because of "export")
So... Where and how do I use this line? Am I suppose to use terminal to type this in? If so, how can I do that in Heroku?

Basically: heroku config:add METEOR_SETTINGS="$(cat settings.json)".

The heroku config:add... command didn't work for me, but I was able to use heroku's dashboard to set my environment variables. You can find the dashboard tab at:
https://dashboard.heroku.com/apps/yourAppName/settings, and then click on Reveal Config Vars

Related

How to deploy nuxt3 application on hosting via FTP

Hello my dear developers. Help me plz with that question.
I have Laravel api application and nuxt 3 as a frontend application.
With Laravel i had no problems with deploing but with nuxt...
So as documention says i need to run nxp nuxi generate command. But its creates fully static site, and its working but api calls not really works.
I want to deploy on my server that has linux and other required thinks also installed (..etc node)
I want to deploy it via ftp. That some pages are static but some pages are requests data from api when we update the page.
How can i do it plz.
I tryed npx nuxi generate.Also with ssr false in nuxt config file.
I tryed npm run build. But its says just error.
Thank you for reviewing my question and comments to it.
So i used npx nuxi generate and also i putted ssr false in nuxtconfig
The i pushed .output/public to my server via ftp.
And everything works great.
In future i want to add some pages in nuxtconfig to preload them. So they will be fully static. Hope i can do it. (i`m still learning...)
The problem that confused me, is that when i did it first time, its loaded with fetched data, and when i tryed to change data. I could see any errors. And when i made my database fully emty it still showed data. But when i tryed to do it now, it works. I dont really understood why. Hope maybe it will help someone. Becouse its not really enought info in interner. Or im just a bad googler xD
Peace to everyone
Since you seem quite new, I recommend that you stick to:
vanilla Vue3 app
hosting on Netlify
When you'll be more comfortable with those, then you could proceed hosting a Nuxt3 app on your own VPS.

meteor mup: building and deploying programatically

I want to set autoscaling for my meteor app.
Ideally I would like to keep build image ready on s3(or some other storage, image would be typically generated from last build) and using aws-lambda(so that no dedicated build server is needed) to deploy using this image on new instance. I would like all this to be finished within 2 minutes.
So is it possible to mup for these tasks
build image and save it to aws s3, without deployment.
run mup deploy programatically using image from aws s3.
No need of mup setup, because I will launch instance with ami which has already been setup.
mup is also setting up ssl for me using letsencrypt.
I am also open to other tools/scripts to achieve this.
You won't get much response from this question, because mup makes deployment life quite simple, and most people who use it don't know much about what it does.
You should have a look at the code of meteor-up to see what it does, and see where you can extend it for your own purposes. You could also look at yamup, as that is another approach to the same problem.

Is there a faster way to update a deployment in Meteor?

To deploy a meteor app, you enter meteor deploy my_first_meteor_app.meteor.com
To update the deployment, is there a faster way than typing the above command again? It's quite tedious if you have a long domain name like the one in this example.
Yes. You can user aliases (nothing to do with Meteor). This is how you do it on a Mac:
alias new_name='command to be performed'
After which you must store the changes permanently in the file:
~/.bash_profile
See a full explanation here: http://www.maclife.com/article/columns/terminal_101_creating_aliases_commands
Also, you can try running meteor deploy without the site name. I don't remember if that works or not though. meteor deploy does remember old settings files that were used, but I'm not sure if it remembers the site name you used too.

Permanently configure Meteor development MongoDB url

I am trying a test to move all my development to Nitrous.io IDE, but with limited space in my Nitrous box I want to permanently host my Mongo databases at MongoHQ.com. Currently each day I need to set my MONGO_URL by running:
export MONGO_URL='mongodb://<user>:<pass>#paulo.mongohq.com:12345/<db>'
If I fire up another console or logout of Nitrous my MONGO_URL needs to set again.
How can I set the development MONGO_URL for good per meteor app? I cannot find a config file anywhere.
Nitrous support helped me find a quick solution. Just wanted to answer it here for others with the same issue.
Open ~/.bash_profile and enter your DB information.
example:
export MONGO_URL='mongodb://jimmy:criket#paulo.mongohq.com:12345/mynitrobox'
Next in the console run source ~/.bash_profile to load the settings.
This sets the DB for your entire node.js box, not individual meteor apps, so you may want to structure your Mongo collections accordingly with subcollections.
you can do this in one line like so:
MONGO_URL='mongodb://<user>:<pass>#paulo.mongohq.com:12345/<db>' meteor
I don't know much about Nitrous.io but in AWS EC2 I have an upstart job that runs this for me when the server starts.
I gist'd my approach a while back, I've since changed it a bit but this still works:
https://gist.github.com/davidworkman9/6466734
I don't know that this will help you in Nitrous.io though, good luck!

Use a MongoHQ db with Meteor on localhost

I wanted to know how to go about getting a MongoHQ db to work on my localhost installation of Meter.
i tried using the settings.json method or the MONGO_URL=mongodb://user:pass#xxxx.mongohq.com:10061/xxxx when firing up meteor but both dont work and are probably the wrong way of doing it.
run it like this in your terminal within your project directory
MONGO_URL=mongodb://user:pass#xxxx.mongohq.com:10061/xxxx meteor
or
export MONGO_URL=mongodb://user:pass#xxxx.mongohq.com:10061/xxxx
meteor

Resources