Do apps generated with yeoman need node.js in production - yeoman

Let's say I am using yeoman to scaffold an application.Now this scaffolding needs node.js.Using node.js during development is completely fine with me.However, do we need node.js in production too ?

No, you don't. If you are using the official angular generator, it produces a static build (in the dist subdirectory) that can be served with any http server, such as Apache or Nginx.

Related

How do you run two different web servers (i.e. processes) on Heroku?

I want to run both my Rails api server and NodeJS frontend server(Express server that serves a React app) on one Heroku app.
I use multiple-buildpacks to build both Rails and Node successfully. However, I am not sure how to run both Puma (Rails) and Express (Nodejs) at the same time. Express will serve all requests to / and Puma will serve all requests to /api/*.
A possible solution is using runit but I am shy to use it because it's not an official buildpack by Heroku.

Is using pub serve as a production webserver correct?

In the docs of pub serve it's written
This command starts up a development server, or dev server, for your Dart web app. The dev server is an HTTP server on localhost that serves up your web app’s assets.
As it states it's a "dev server", does it mean I should not use pub serve as a production web server? What are the alternatives?
Also as of right now when I use pub serve it also serves my tests on another port (I don't think this is desirable for production, hence this question). Is there an option in pub to prevent it from serving my tests and use pub serve --mode=release? (if that's appropriate)
pub serve is definitely not for production. For production generate JavaScript output using pub build and serve the result (from build/web) with any production web server of your choice (like Apache, Nginx, ...)

Setting up Rails on Hostmonster

I'm able to run rails s through ssh successfully and see the app start up just as it does on my own machine but I'm unable to access the app from the web. The app is directly under the home folder and I have a symbolic link pointing from public_html to the public folder of my rails app, just as this tutorial explains. I even tried setting up a subdomain and every other step in the tutorial to no avail. Any help would be highly appreciated.
You need an application server like Phusion Passenger, Unicorn or puma to run a Ruby app in a production environment. Typically, you'll integrate the application server into a web server's (Apache, nginx) environment.
I don't know about your hoster, but if you have root access, then you can probably use any of these application servers.
The built-in server you start by running rails server is only meant for testing purposes on your local machine. It has not been made with security, performance, stability or any other production-environment criteria in mind.

AngularJS frontend and Rails backend with AWS in Ubuntu

I would like to discuss about AngularJS and Ruby on Rails working together and deployed in AWS (Amazon Web Services).
So far, I have a development environment with an AngularJS frontend that sends request to a Ruby on Rails API backend. These both are two separate applications (they are in separated git repositories).
The AngularJS app is running in a Node.js server listening on one port, and Rails is running in a Webrick server listening on another port.
Although they work together, AngularJS is not physically integrated in the RoR app.
Now its time to deploy in production environment. For that, I will use an EC2 AWS instance (currently deploying using Elastic Beanstalk). As far as I understand, I can't have the same architecture here.
I would like to know your suggestions this point. Do you see any advantages or disadvantages?
Should I update my development environment, so the AngularJS app is integrated inside the RoR application (and deploy just one application)?
This is something I don't like, because I guess I have to modify many things.
On the other hand, is it possible to run both applications separately, the same way I do in development?
Can I install a node.js and a Unicorn or whichever server manually in production in the same instance?
I finally deployed with two separated applications as described above. The main difference is around the servers. My AngularJS frontend finally runs on an Nginx. And my Rails API is running on a Unicorn.

Javascript not working in production: Nginx, Passenger, Rails on Ubuntu Server (Node.js?)

Do I need to install/config Node.js to get Javascript running?
Is this the simplest solution, seeing that my site has really low traffic?
Javascript doesn't seem to work for me but only in production for a site I am running. The site is setup on the latest version of Ubuntu Server, with Nginx and Passenger (it's a Ruby on Rails app). The site runs great and fast for the past few months, but Javascripts (in particular, things like Twitter Bootstrap's tooltip, etc.) don't run on this production server although they work in my testing/dev environments.
My thoughts are that Javascript is broken b/c I need to install/configure Node.js? I've seen Node.js mentioned in some deployment setup guides but can't find detailed info into if this is necessary.
My site is very low traffic (maybe 3-5 users at any time) for a small company website. The only reason I needed to setup my own web server is that I needed to run the app on the private company network to access certain resources.
By default your js/css don't compiled. You should precompile them.
You can run "bundle exec rake assets:precompile" on your computer and deploy compiled code to the server. Instead node.js you can use therubyracer gem.
For more information read rails guide

Resources