Nodejs executing microvm with Vagrant : terminal simulation - node.js

Introduction
I am currently working on a Nodejs project to run a simulation of an Ubuntu terminal in a secure way.
To do this, I intend to use Vagrant in the NodeJs application to run a microVM and redirect outputs to the front page.
Problem
I don't know if the utilization of Vagrant it's a good solution, and how to do this.
Question
Do you have a solution for executing a microVM inside NodeJS application, and redirecting the outputs to a front web ?

Related

Running a bash script in nodejs application deployed on amazon ECS

I have a nodejs application that is deployed on Amazon ECS. I have setup codepipeline to automatically build and deploy the application. The application is dockerized and is deployed on a ubuntu machine. The application is working fine. However, there is a requirement to run a shell script from within the application. I am calling the shell script using await exec(path/to/shellscript). However, I keep getting the following error:
2021-02-08 17:19:48FAILED: undefined, 4e9d8424-3cfd-4f35-93cb-fac886b1c4918fc9f680cfea45ec813db787f8b8380a
2021-02-08 17:19:48/bin/sh: src/myApp/myScript.bash: not found
I have tried giving it permission using chmod but I keep getting errors still.
Any help is appreciated.
I realized that the script that I am running calls an executable created to run on Ubuntu. However, the docker image is an alpine Linux distribution. The issue has been explained in detail here:
Why can't I run a C program built on alpine on ubuntu?

How to run React Web Application forever

I have created a web application using React framework. I am able to Run it in localhost using npm start command.
I have a server in AWS ubuntu 14.04. I have uploaded all code there and run the application using npm command. It is working well. But if i close the terminal then it has been stopped. I know we need to run that instance or service. But how can we do it forever without any UI of ubuntu?
Did you link the public directory's file(HTMl/PHP file) to your dedicated host server?
If not, Look to do how to setup it with AWS in local you can do it with virtual hosting. I'm sure in AWS there'll be any same way to do.
You can use a library called forever which will keep the process running in the background.
https://github.com/foreverjs/forever

confused about writing script for helloworld.js using node-windows in nodejs

I am using node-windows in nodejs to run my nodejs script as a windows service.
now let's suppose that my helloworld.js code is a simple command which creates a folder on desktop. how do I execute this code ??
because my service app starts successfully but it does not do anything at all. it creates no directories on desktop.
please help..
what error am I doing?

Is it a good idea to use NodeJS terminal or iisnode

I have micorosoft windows server 2012 r2 and I have nodejs as web and api server and I want to deply it in production mode. But my question is should i install forever npm module and set to production mode and run via command prompt and may be write .bat file to execute on start up or iisnode is a better idea.
I think that iisnode is a better idea.
Host using IIS is better than let a nodejs prompt always opened, running your server, with a danger of someone close or do something that you don't want.
I always use iisnode and is very simple, look at Github page.

Running mongodb in production

I am currently building a web app using express.js and mongodb. My problem is I do not know how to run mongodb itself in production. Because in the development, I used mongod command, but it need the terminal to be open so mongodb will run. How can I do this in the real server? In my express app, I just use pm2 to run it.
Since you are not an expert on managing this, I would suggest you to use some mongodb-as-a-service, so that they manage that for you and you just simply access it. for example: https://mongolab.com/
Or you can use https://www.mongodb.com/cloud so that you can just lunch a few commands in your server and mongodb+backup will be installed in your server and you can update, or make clusters simply using their interface.
Or if you want to install it in your server, guessing you are using linux, and probably an ubuntu based distro you can run mongod like #aiobe suggested: sudo service mongod start

Resources