Running AdonisJS on C9.io - node.js

I'm trying to create a new Node.JS app using the Adonis framework. I'm using c9.io as my IDE.
I've succesfully installed everything and created a new project. But when I run it (using npm run dev) c9.io keeps showing me the "No application seems to be running here!" message.
The .env file is set for port 3333 for default. But I also tried changing it to 8080, and nothing changed.
Anyone managed to run AdonisJS on c9.io before? Thank you!

Make sure you are running the app on 0.0.0.0, not localhost. Localhost won't work on Cloud9 so you'll need to use 0.0.0.0 or process.env.IP (which will usually be the same thing).

I created a github for installing AdonisJS on c9 for anyone using this Framework on Cloud 9, as I imagine more people will run into issues installing Adonis on c9.
https://github.com/Devitgg/Cloud9-Adonis-JS-Framework-Installer

Related

When running two NodeJs apps in same vps one use others .env conf and get connected to the wrong db

I have a VPS with Instance (Debian 9.4 (stretch) 20180404)
There I have a few WordPress sites and also a nodejs app that I will call "prod" running with PM2 without any problem whit apache2.
Now I want to run a new nodejs app on a subdomain which basically will be the dev environment of the previous and working node.
My issue is that when I start dev, prod gets connected to dev's database, no matter if I run dev as "node inde.js" or by PM2.
Each node environment is in its correct web folder and has a specific .env that has the credentials to access each database (one for prod and another for dev)
Could anybody please help me to sort out this issue?
On the apache2 config, I configure a proxypass reverse so I don't have to add the:3000 and I copied the conf to dev, could be that a problem? Are both listening to the same port? if yes, how do you suggest solving it?
Thanks in advance!
I resolved it.
I leave the solution in case anybody comes to the same issue.
The problem was indeed the port, so I'm using port 3000 for production and port 3002 for dev.
Also with the .env files, I decided to have one .env file for each environment and both are in the same location outside the git repository.
Everything works as expected.
Cheers!

AWS EC2 instance is working but can't connect to it via browser

I have a nodejs app running on an EC2 instance. I installed the webapp using Ubuntu server 18.04 and node version v16.x using this link:
Node installation guide v16.x
To run the project I used the following tutorial: Tutorial link
The problem I am facing is that when I run the starting command npm start my app launches on the server using port 3000. But whenever I open the link provided from AWS which in my case is : https://ec2-3-72-79-132.eu-central-1.compute.amazonaws.com it doesn't respond. I saw some similar questions and most common answers were to edit the inbound security groups which I did.
But it still doesn't work. I also tried to access the link with http only like this:
http://ec2-3-72-79-132.eu-central-1.compute.amazonaws.com:3000 but it still doesn't work. Any help will be highly appreciated, because I spent 2 days struggling with this issue and I see that I don't make any progress.

Django, unable to start on local:host

I am using dj4e in pythonanywhere.com, I am trying to start the project but it gives an error saying that port 8000 is already in use. I tried to run from another port but nothing.
In dj4e's document, it says I can't use "runserver" command in
virtualenv.
Could somebody help me running the local server, please?
You need to deploy your web app to run it on PythonAnywhere. runserver would not work there. You may follow https://help.pythonanywhere.com/pages/DeployExistingDjangoProject/

Unable to start the nodeapp through terminal

I have a node app locally and I normally run it using the run button in the web storm, which works fine. While I am documenting the project I came across this blocker: if I try running the same app through the terminal using the command: node app.js , the server starts but the browser throws and error stating "This site can’t be reached" "localhost refused to connect".
Because the port is occupied.
You can change it using app.listen({port})...
or
linux:
export PORT=4500
node server.js
windows:
set PORT=4500
node server.js
I found this myself.. since I used the scaffolding app and it stores info related to server at bin/www, so we will not be able to run the app using the command : node app.js but instead we could run the app using nodemon(which I installed globally on my machine)
Love nodemon for this awesome feature <3 :)

How to run the seed.js, given in the generator-angular-fullstack, on OpenShift?

I'm developing an app, using MEAN.js and its generator (https://github.com/DaftMonk/generator-angular-fullstack), and Openshift as a hosting.
The project template of the generator includes a script (server/config/seed.js) to populate the database with two users.
In localhost, it is called automatically, but I also can call it using node server/config/seed.js (suppose you're on the root app directory).
The problem is, when I deploy it to Openshift, I run it and no error is reported, but the mongodb database is not updated. The exactly steps I do to run it on Openshift are:
Connect to ssh: ssh ....
cd app-root/runtime/repo/
`node server/config/seed.js``
What am I missing?
Thanks in advance.
You have few options:
in server/config/production.js add
seedDB: true
or change NODE_ENV to development coz during 1st deployment it is set to production
then
grunt
grunt:buildcontrol:openshift
should be working now

Resources