Connect to Parse to herokuapp.com/parse server? - javascript

Since parse is now closing I have switched my database using MongoLab & Heroku using nodejs with Heroku.
Parse makes it easy to connect to your new Database in iOS using ParseUI to point my server ".herokuapp.com/parse".
The question I have is now I want to point to this server using javascript. How do I use parse to get its database at my ".herokuapp.com/parse" database using javascript?
Thanks

If you mean how to set the serverURL, it can be done in the javascript sdk like this:
Parse.initialize('appId');
Parse.serverURL = 'https://myappid.herokuapp.com/parse';
This is only required if you are using the javascript sdk in the browser however. In nodejs, parse-server exports an already initialized js sdk as the global variable Parse which can be used from everywhere.

Related

Is it possible to get JSON from a URL and save it as json file with a custom name inside a specified path/folder through the front end?

My issue is simple on paper - I have a React Native project and I'm trying to make a script that will run on build and fetch JSON from a URL, then save it as JSON file with a custom name inside a specified path/folder. For example, I want to access the JSON at www.example.com and save it as a JSON file in project/src/assets/locales/en.json
The problem is that when I google how to fetch and save JSON, most of the results are related to Node.js and I don't think I can use them. Is what I'm trying to do possible?
Since you've said you're doing this in a git push hook, you can use any of several things for this:
You can indeed use Node.js, by having the hook run it via node, and then using Node.js's http client (to read it) and fs module (to write it to a file).
You can use a shell script, perhaps using with curl or wget (on platforms where those are available).
Since you're already writing JavaScript code for the app itself, Node.js is a reasonable choice.

Migrating Chrome Extension Data from Chrome Local Storage to MongoDB

**I'm new to this field. I'm making a plugin that stores text data to chrome local storage using chrome.storage.local.set api. All I want is to Migrate that data from chrome local storage to MongoDB server. Is there any way to do it??..
You would need a server side for that.
What you can do is create a route in your server side that will save the data to the mongodb database and call it using the fetch api in your client's javascript.
I would recommend NodeJS and Express for that server side as it is coded in JS that you probably already know and the api is fairly simple.

How to use a Node.js library on client side javascript where a server is not available

I'm creating an Ethereum wallet in phonegap. I need to use the Vanitheth library to generate the keypairs (https://github.com/MyEtherWallet/VanityEth)
My problem is that VanityEth runs on node.js, which require a server. Phonegap runs client-side code, so I need to somehow make this library accessible to phonegap without connecting to a server or node. Is there a way to convert this library into a .js front end file that I could include in my application and access it?

Connecting with MongoDB in Javascript without NodeJs

I have an UI5 Application [Mobile-Fiori], and I would like to connect it with MongoDB to get JSON data to be displayed in my views.
I know it would have been possible if I used Node.js with the package Mongoose, but for my applications developed locally, I use Eclipse with Tomcat Server.
I wonder if this is possible in this way.
Thanks
Yes it is possible, e.g. with Spring Data MongoDB.

Connectin to MongoDB using Javascript

I am working on a little fun project(webcalender) and I want to use mongoDB. MongoDB is running and I figured out how to deal with it. I also got the connection to PHP.
I was wondering is there any chance to connect to the MongoDB using simple javascript?
I have searched a lot and I always passed by Node.js? Do I need Node.js to connect to mongoDB over Javascript?
Does anyone have a great link? Tutorial? or arguments why I should not do that?
Thanks for help
there are client side ways of doing this but its not safe at all.
there are a few reasons for the lack of security.
1. connection info is in the source for anyone to see.
2. if you use a service like mongoHQ where its a restful API to connect to Mongo your secret is exposed on the client side.
Both of these reasons scared me enough to not use a JS library that allowed me to connect to mongo on client side.
is your application being built in node? or PHP?
if PHP I know theres a PEAR library for MongoDB, then you can use javascript on the client side to interact with php to do what you need on the DB.
if the application is being built in node.js then sure why not? I've had success using Mongoose with express in node.
hope that helps.
Yes, you need Node.js to access MongoDB via JavaScript, because simple plain JavaScript runs on the user browser, not on the server, and Node.js is meant to run on the server.
Accessing a database directly from the browser would be a huge security issue, since JS files are always available to those viewing the page.

Categories

Resources