Deploy create-react-app build version to Heroku - javascript

I'm working with a create-react-app generated app which I'm deploying to Heroku. I would like to test out the production version npm run build in an actual server.
Is it possible to serve the build version instead of the development version to heroku? It's okay if I can no longer have the dev version up in that heroku instance.
If possible, how can I do so, I have been searching up and nothing comes up

If you're following standard documentation on how to deploy react app to heroku, you're already running the production build on heroku.
That documentation uses create-react-app-buildback for deployment and serving the app via Nginx. You can refer to this section that explains that the app is served from build directory
There is a way to verify this too. If you have react developer tools extension installed on your browser, it shows if the app is running production version or development version.

Related

How to build and deploy a Nodejs console project created in Visual Studio

In Visual Studio you can create a NodeJS console application, you can run and debug in Visual Studio.
I want to deploy it on a window server, beside with IIS, my IIS web application can invoke it through Jering.Javascript.NodeJS from my c# code(Asp.net):
StaticNodeJSService.InvokeFromFileAsync<string>("nodejs\app.js", args: new string[] {})
When I build the project in Visual Studio, the bin folder only has this file: Microsoft.NodejsTools.WebRole.dll, I have no idea what this file is for.
It works on my local, because I have nodejs runtime environment set up and all dependencies installed under npm.
Now I want to deploy it on server, one way to make it work on server is to copy all the project files into a folder and install all the dependencies through npm, If I have to do so, what the visual studio 'build' for?
we use pm2 to manage node js apps on windows
Install pm2 as windows service, use pm2 start to start your app
then you can call it in C# code through http or socket

How to deploy Laravel + Nuxt application?

I have built Web application using Laravel As API and Nuxt As Front and. These 2 built desperately. When the development ongoing Its isn't an issue. Because i can run them using their own development servers. Then i have bought a VPS server for host this. Now the question in how i deploy these two apps on my VPS. Specially How i can deploy nuxt app correctly in vps. Its not static side. It is ssr app.
Essentially, you are going to need a few things:
A server (which you already have)
nginx
PM2
Node/NPM installed
The tricky part of this, is to make sure the server continues running and auto-restarts in case of a crash. PM2 solves that issue, and you can read more information on how to use it here: https://nuxtjs.org/docs/2.x/deployment/deployment-pm2
You can install it by:
npm install -g pm2
Which will install PM2 globally on your server and you'll have access to the pm2 command.
Follow the documentation above, and all you gotta do is run:
pm2 start all
This will start the Nuxt service and it will run on whichever port you've defined on your nuxt.config.js or package.json files.
Now that you've got your Nuxt instance running, you need to make sure that requests that come through the browser end up on the port that Nuxt is running on, that's achievable by using nginx's reverse proxy feature that you can read more about:
https://nuxtjs.org/docs/2.x/deployment/nginx-proxy/
That documentation provides you with an example of an nginx config file, and you shouldn't really have to change anything other than the server_name, and the proxy_pass in case you've changed the default Nuxt port from 3000 to something else.
Additionally make sure that you have allowed port 80 to be listen on your server.

Javascript version mismatch for Tabris framework

Few month ago I gave a try to Tabris, a nice framework for the development of native Android and iOS apps in Javascript. I wanted to get back to it today but my test app has javascript version issues.
First, the QR code scanning on Tabris mobile app side failed with error udefined. I setup the IP address manually and the app got connected to the Tabris server running on my laptop. However, the console on the mobile app complains with: Version mismatch: Javascript module "Tabris" (version 3.5.0) is incompatible with the native tabris platform (version 3.6.0)..
I started by upgrading tabris-cli with npm i -g tabris-cli. It didn't help. Then I uninstalled and reinstalled both the mobile app and tabris-cli. Both are now in version 3.6.0 but the same error remains.
Any idea ?
The Version mismatch error stems from the fact that the native application code and the code of the JavaScript framework of your project are different. If you look at the package.json file of the directory where you are running tabris serve it will probably have the tabris dependency set to 3.5.0
You can update it by running this command:
npm install tabris#3.6.0 --save

react serve works, but deploying to github pages or heroku fails

I'm trying to deploy this repo
https://github.com/stepseazy/checkers/
to this website
https://stepseazy.github.io/checkers
However, I'm getting 404 errors. I also tried heroku. It does work when I serve the build locally. Not sure what's wrong. Please help!!!
You'll have to distinguish your dev environment and your production one. On dev mode, you run npm start that does things (as instructed in package.json) and act as a local server and serves you project on http://localhost:3000. You simply cannot use that in production mode on Github or Heroku.
You need to deploy the built version, running npm run build. It will create a javascript file in a dist folder. You might want, on Github, create a gh-pages branch, build this production ready file on it, create an index.html file that serves it, and commit that.
I'm no expert on Heroku but it might be a slightly similar case (run post-deploy scripts that build your app and serve it through an index.html file).
Hope that help.

Where is the .meteor directory in an app deployed by mup?

I am using mup to deploy my Meteor app to AWS, but I can't find a .meteor folder on the server.
How I can find my meteor folder on AWS VPC?
Once you build your Meteor application, as mup (meteor-up) does, a bundle is created, and this bundle is a normal Node.js application.
Therefore, there is no .meteor directory within it, as well as all of the other development-time tools from the meteor CLI.
Mup classic builds your meteor application and deploy it on your server on /opt//app
Mup is an abandoned project, that's why I forked it and built yamup (Yet Another Meteor Up), that you can find at https://github.com/bordalix/yamup
It works with the latest versions of Meteor and with Ubuntu up until 16.

Categories

Resources