Parse.com To Do web app deployment issue - javascript

Apologies for basic question. I am very new in web development . I have download parse.com javascript web To Do App from https://parse.com/tutorials/todo-app-with-javascript . Now I want to deploy with parse.com. So that I can browse this app using http://mytestapp.parseapp.com. But when try to deploy using "parse deploy" command getting error as "Command must be run in a directory containing a Parse project."
Can you please help out me by step by step process.

Did you follow deployment rule of parse?
If your directory structure (from where you run command) is not as below you'll get the same error:
-config/
global.json
-cloud/
main.js
-public/
index.html
If the keys config/global.json do not matches to yours then also you'll error.

Related

Reduce deployment size of JS Azure Function App

I had followed this article a while back https://adrianhall.github.io/typescript/2020/01/12/fixing-functions-deployment/
To reduce the zip folder size of my JS Azure Function app. I tried to deploy today as normal (I use the azure function extension in VSCode to deploy) however it is getting stuck in the "Creating Zip package..." step. When this happened before I added node_modules/azure-functions-core-tools to the .funcignore file which has worked for the last few months. I'm assuming the reason it is stuck is due to the app size being too large.
Having ran the following to determine which node-modules were the largest -
du -ks node_modules/*/. | sort -rn
I got the following results
My question is - can I add node_modules/aws-sdk to the .funcignore file? or is this required in the deployment?
Any help would be greatly appreciated
I have tried to create a sample function in VS code, tried to publish from vs code to azure function app and got deployed successfully.
Output of the function running locally:
And I also excluded the node_modules/aws-sdk package by using the .funcignore file and published the function to the Azure App Service successfully as shown in the below screenshot:
Note: There is a limitation of azure zip deployment to 2 GB and If your zip deployment file size is more than 2 GB then it will stuck while deploying the FunctionApp.
You can exclude that particular package and publish to Azure without any issues.

Gatsby development server stops working when repo is created on github. Sanity, Gatsby Error

I received a github repo backup from somebody elses account. The project is running gatsby, sanity cms and is hosted via netlify. When I extract the archive and saving the folder locally, I am perfectly able to get the gatsby development server runnning just by doing "yarn install" and "yarn gatsby develop".
However, when I create a new repo and import the project to my github account, the development server is not running anymore. We tried it on several machines and we always get the same error in terminal trying "yarn gatsby develop".
success open and validate gatsby-configs - 0.131s
success load plugins - 2.486s
success onPreInit - 0.038s
success initialize cache - 0.009s
success copy gatsby files - 0.091s
info [sanity] Fetching remote GraphQL schema
ERROR #gatsby-source-sanity_drafts.10003
[sanity] The token specified is not valid or has been deleted
How is that possible? I tried to fix this for days but I don't get it. The only differnce between being able to run the dev server and this error is to save the code to github... Is it maybe some sort of routing problem in the gatsby-config.js?
Would appreciate your help a lot!
It seems that you are missing the environment variables in your new projects so your Sanity configuration is not valid, hence Gatsby is not able to fetch the data from the sources.
There should be a .env.development or .env.production files in your original code placed in the root of the project.

Undefined error in build version with electron

I have an electron app, the app is working when I am running:
npm run electron-dev
I am creating a build folder using react-scripts:
yarn react-scripts build
Than I am trying to build it using electron builder with the command:
yarn electron-builder -c.extraMetadata.main=build/electron.js
This is working well and I am getting a dist and a build folders with the compiled app and a build.
But when I am clicking the app I am getting:
A JavaScript error occurred in the main process
Uncaught Exception:
undefined: undefined
Compilation success messages
When running the app via electron-dev (on the build folder or on the public folder) I am getting no errors, but I am getting 3 warning messages, 2 from firebase - "When deploying Firebase apps to production, it is advisable to only import the individual SDK components you intend to use.", "Warning: This is a browser-targeted Firebase bundle but it appears it is being run in a Node environment." and 1 about security "Electron Security Warning (Insecure Content-Security-Policy) This renderer process has either no Content Security Policy set or a policy with "unsafe-eval" enabled.".
TD;DR: How can I understand where the error is coming from and why, if the error shows only undefined: undefined?
Maybe through try and catch but than how can I display it on the error I am getting?
I'm working on Mac OSX (But it does not looks like this is the problem), I am using opencv4nodejs which takes a long time to compile, also I am using some json files to store app data using electron-json-storage.

cannot start nodejs web api hosted in Azure

Learning nodejs and started to created my own restful API using restify.
I have created a very simple server.js file which contains basically a hello world type example starting up like:
server.post('/api/messages', servicemanager.verifyFramework(), servicemanager.listen());
server.get(/.*/, restify.serveStatic({
'directory': '.',
'default': 'index.html'
}));
server.listen(process.env.port || 3978, function () {
console.log('%s listening to %s', server.name, server.url);
});
which works fine locally. I cant hit http://localhost:3978 and I can test my API calls just fine calling http://localhost:3978/api/messages.
I have deployed my code into bitbucket and now I want to host these APIs in Azure using App Services.
My project structure is like so:
/topfolder
-/myproject
-/node_modules
-/node_modules...
server.js
package.json
index.html
When I setup the new app service in Azure, I can see that the deployment receives the code from BB, but the service never responds to my requests.
I have setup the home path of the app to live in: /site/wwwroot/topfolder/myproject and I can see the index.html when I navigate to http://myproject.azurewebsites.net so thats good.
I actually get a 404 error:
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
There are heaps of examples of how to setup continuous deployment using bitbucket and for the most part, they all seem to work, but my server.js file doesnt seem to be the getting called or starting up.
How can I debug whats going on here?
Is the packages.json file used in this scenario by Azure?
Thanks.
As the root directory path of the application hosted on Azure App Services, is D:\home\site\wwwroot. And about the nodejs application, the Azure fabric will find the entrance script in root directory like server.js. And the requests are handled via web.config in root directory. If there is missing server.js or web,config file, you will occur 404 error.
You can try to modify or your application's structure, like to:
-/node_modules
-/node_modules...
server.js
package.json
index.html
Then, you deploy your application to Azure via GIT or from BB, the Azure deployment task will run command npm install and generate the web.config wile in the root directory.
Any further concern, please feel free to let me know.

PhantomJS not working with Jenkins

I followed Web page Capture and save to image using phantomjs lib and able to save screenshot on my local.
However when executing PhantomJS command with Jenkins, following error is generated: "_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL." and screen shot is not saved on Jenkins.
Can anyone please guide me?
I've found two possible solutions to this problem:
As user2325313 commented, if you login as the Jenkins' user you should be able to avoid this issue.
Run Jenkins as a standalone application instead of a daemon. To do so, locate your Jenkins .war file and execute it from the terminal using the following command :
java -jar /Applications/Jenkins/jenkins.war

Categories