i'm playing around on cloud9 with node.
i can get a very simple express app working
Now i want to add an sql database to this.
however as soon as I install phpmyadmin [phpmyadmin-ctl install] the above program no longer works.
i suspect it has something to do with ports but can't find a way round it - anyone able to help?
thanks
Related
I will be straight to the point, I have 0 understanding of nodeJS.
I built an application in codeigniter, and I then purchased a codeigniter chat script. The chat script works, however it uses nodeJS and sockets to get real time updates.
I enabled Node in easy apache 4, but have no clue what to do next. It says i need to run node server.js
so i typed that in SSH but it says command not found.
I really don't understand anything! Any help is appreciated
I am fairly new to NodeJS, here is the problem statement:
I have a small app (let's consider default app) of ReactJS. I installed NodeJs on my Ubuntu Server. Now when I hit mydomain.com in a browser I want my ReactJS app to show there. I know I need to do some configuration but somehow not able to find what's the right way of doing it. I have nothing installed on my Ubuntu server except NodeJS and npm.
Any suggestion will help me.
Thanks
For pure Node.js solution, tou can use static files (HTML/JS/CSS) HTTP server like following
https://github.com/cloudhead/node-static
https://github.com/indexzero/http-server
I've used http-server which is super simple and can be installed as a CLI tool as well
I'm currently making an app using express, mongodb and mongoose, and I'm running it locally on my machine. My problem is that if I'm not connected to the internet the app won't run at all due to the app not being able to connect to mongodb server.
I thought that if I ran the mongodb server locally on my computer along with the app then I wouldn't need an internet connection, or is my understanding wrong?
Any help would be much appreciated.
The answer is: yes.
If you install MongoDB locally then you won't need internet connection to access it.
Make sure that your connection string contains "localhost".
Also, make sure that you don't need anything else on the internet, and that you run npm install while you are connected to the internet, or otherwise your dependencies (like mongoose) won't get installed. After they are installed they can work without the internet connection just fine - if your database is on localhost.
Also, make sure that your local MongoDB server is running. You can run:
mongo test
in the command line to see if you can connect to a local database.
You're in the right path !
Here's the thing, you need to get yourself a copy of MongoDB, you can download and install the suitable version to your system from here.
Now you need to configure MongoDB in your in your path so you can launch it when you is or simply add it a process that will launch when your system starts.
In order to configure please choose the suitable conf to your system :
Windows.
Linux.
macOS.
Then, before running your application, make sure MongoDB is running in the background ad service or daemon and then simply launch your application.
I'm currently moving on with reading about node. I'm getting through the tutorials well using the command line. However I am thinking ahead and I want to create a simple register, log in and log out website.
Where would I place the node files on a server (all examples I see run from local host:3000)?
What is the best tutorial for creating this type of website from scratch with node?
Thanks in advance!
It doesn't really matter where you put the files on the server. The localhost:3000 bit comes from the fact that your core server file tells the server to listen on that port.
I would recommend using the express-generator from npm. It's pretty versatile and does a lot of the leg work.
Just run the following:
npm install express-generator
After installing, you'll need to just run the following to create a new web app:
express
The details are here: http://expressjs.com/starter/generator.html.
Also, try to read through and understand all of the pre-provided code.
I've been following this tutorial : http://cwbuecheler.com/web/tutorials/2014/restful-web-app-node-express-mongodb/, and I don't understand what I need to do in order to get my app to use it. I've successfully installed everything with node.js up until to where the directions at
part4: mongodb
mongo
this call doesn't start the mongodb like it should. I've installed mongodb and saved in C:\mongo like the directions suggest but I can't access the mongo console. My guess is that I don't have it in the right path because when I try:
C:\mongo\
mongod --dbpath c:\node\nodetest2\data
c:\mongo\
use nodetest3
it throws:
"use is not recognized as an internal command...etc"
That leads me to believe that it's not installed correctly after I do:
npm install mongodb
Another troubleshooting idea I have is trying to correct the variable path, maybe? It's probably a much more simple issue about it's file placement/installation directory. I'm at a total loss at this point.
I want to reiterate that I've tried the directions in the other similar questions that have already been asked, but it doesn't seem to work. I think I need more detailed questions, where my experience level isn't assumed (I know that this is a beginner tut, and its database section is just little a above my expertise at this point.