Cannot find jquery.couch.js - javascript

I am trying to get started using couchDB. While standing up a cluster of three docker containers is easy enough using this GitHub repo, I cannot create a javascript program to query the database.
All the guides I find say the required libraries live at:
http://127.0.0.1:15984/_utils/script/jquery.couch.js
and
http://127.0.0.1:15984/_utils/script/jquery.js
However, when I try to run this, I keep getting a not found response. What am I doing wrong?
Note:
I know normally the port is 5984 but with my docker cluster 15984
is the correct choice
Going to localhost:15984/_utils, localhost:25984/_utils, and localhost:35984/_utils takes me to the CouchDB interface.
I cannot connect to the couchdb using the container's IP addresses
I can also use 172.17.0.1 in place of localhost

Related

How do I connect to my SSH VPS in google cloud?

So im really new with these VPS stuff, Always wanted to host my discord bots in them, Then I see Google cloud with a $300 credit so I said why not, After I signed up and created an EC2 instance Thing is though, I've never used a VPS on SSH, I've tried tutorials on youtube but none works. My questions is, How do I connect to my SSH VPS through "FileZilla" or "PuTTy"? I've tried PuTTyGen like in youtube vids, But they don't bring me to my "captionedcan" account. So I can't really import anything to my "captionedcan"s folders.
First of all, I can see that you are familiar with AWS, but I want to let you know that there are some differences on the name of the services, for example Amazon Elastic Compute Cloud (Amazon EC2) has its equivalent in Google Cloud Platform, its name is Compute Engine you could check the following document that provides a side-by-side comparison of the various services available on AWS and Google Cloud.
On the other hand, a simple way to connect to Linux instance (Your VPS) is through the Google Cloud Console and you can follow the next steps:
In the Cloud Console, go to the VM instances page.
In the list of virtual machine instances, click SSH in the row of the instance that you want to connect to.
I hope you find this information useful.

How to store images out of meteor project on live server but access them from web

I have a small meteor project for image library. I have 100K images to be already uploaded on server and use them in my project.
when create a bundle with images inside /public/img/ folder, all resource entries are present inside bundle\programs\web.browser\program.json which makes it ~40MB. when I try to start server live on VPS server, it does not start unfortunately.
So I need suggestion how to manage these images to be accessed from web using meteor?
NOTE : I already know little about S3 storage, But I want to keep is simple and only on my server.
Using S3 doesn't have to be complicated. You can set it up quickly and it will solve the issue you are having.
I'd recommend you read this great article by The Meteor Chef to find out how to use S3!

How to use alanning roles in Meteor react js?

I am trying to build simple user authentication system in meteor react js but I am not able to add roles to created user I don't know what is going wrong in my project https://github.com/robertjchow/cv
Thanks in advance.
Searching your repository for Roles. calls reveals, that only your client code is adding users to roles.
Now let's think a minute about the fact that client code can be manipulated.
Do you think that this is still a valid authentication, when clients can add users to roles?
Now going a step further and checking the documentation of the package at: https://github.com/alanning/meteor-roles reveals, that the documentation is adding roles only at the server side, while on the client side it only allows reading via isInRole.
Therefore your next steps should be to create new users only on the server with methods and also add the Roles also only there.
Update: To create new users on your server, you need to add the accounts-password package (but keep the accounts-base package). Otherwise there would be no Accounts.createUser function available.
Further reading: https://docs.meteor.com/api/passwords.html

How can I get the URL of the currently connected MongoDB database from inside Meteor?

Background: I am preparing a Meteor app for production, and in particular I am adding server logging. To do this I am using winston with the MongoDB plugin. This requires the URL to the database. These databases are different between production and development environments so I want to set it programatically.
I am trying to avoid running forking a script to run
# meteor mongo --url
I also don't have access to $MONGO_URL on the development server (it doesn't appear to be set, for instance in process.env.MONGO_URL)
I expect that there is something like below, but I couldn't find this in the documentation or via Google.
Meteor.MongoDB.getURL();
Sorry if this is something really obvious...it feels like it should be easy.
This works server side. It needs Meteor 1.0.4+ (I think. Added somewhat recently):
var collection = new Mongo.Collection("some_collection");
console.log(collection.rawCollection().db.options.url)
Keep in mind you can have multiple MongoDB's (at least at the collection level, or this is how the design is at least, anyway) so you need to query a collection for its Mongo URL.
I found the answer.
As mentioned in the question, the MONGO_URL environmental variable was undefined, but that appears to be either a misunderstanding or a bug in my IDE.
When I logged the value of process.env, I saw that MONGO_URL was indeed set, so I've used that.
In short:
process.env.MONGO_URL

Getting data out of Mongodb with Angularjs

I come from a LAMP stack background but lately I am been interested in Node.js/Angluarjs combo. Now I am wanting to get Mongodb into the mix but I am having the hardest time getting it set up. Every tutorial I find using a different kind of stack, some are using Express.js, others Mongoose, or something else. How do I go about using angularjs HTTP service to connect to Mongo? Do I need an intermediate library like Mongoose or can I do it directly with Angular. I had set this up a while back as an experiment. I am trying to do what I am doing in this page. In this, I am storing the data in a JSON file. I want to replace that JSON file with a connection to the Mongodb. I have MongoDb installed globally for Node and I have created a data collection through the console. You can see my experiment here - http://monkbunker.com/saas/#/
And the code for the http connection I have for this can be seen here starting on line 14 https://github.com/seanandersonmke/saas/blob/master/js/main.js
Is this similar to how I can work with MongoDB? How to set up an initial connection? I have sat down several times now for hours and ended up stumped every time. Please help.
thanks.
Have a look on the following links:
Querying MongoDB with JSON / HTTP / REST Interface
Does MongoDB have a native REST interface?
There is a full python proxy solution:
http://python-eve.org/
Maybe this is helpful for you.:)

Categories

Resources