I have been looking over this tutorial: http://ox86.tumblr.com/post/45184656062/running-your-meteor-js-application-on-your-own-server but having a hard time understanding how it works.
All of my code is in git (on bitbucket.org) so, I can skip the bundling command, but do I need to install Node.js separate from installing Meteor or does installing Meteor take care of that for me?
Meteor requires NodeJS (it runs on it), so you need to install NodeJS first.
Meteor uses MongoDB so you need to install it as well.
Next up, install Meteor of course. It's on their website.
You'd need Meteorite for packages, if any.
Then bundle and deploy your application.
With all that hassle in the tutorial, there are other ways to do installation, and is much more easier.
Deploy to meteor.com. They allow you to host your apps under a subdomain of meteor.com. Then, purchase your own domain name, and have it point to your subdomain:
You can also deploy to your own domain. Just set up the hostname you want to use as a CNAME to origin.meteor.com, then deploy to that name.
Platform-As-A-Service (PAAS). Heroku would be a good example. They give you a platform to run your apps, not necessarily just a web server. It's similar to how meteor.com runs. Likewise, you can also purchase a domain name and point to it.
Virtual Private Server. It's a computer in the cloud. They typically run Linux. You get SSH access to it, and run stuff like you would on the terminal of your PC. This would require a bit more technical stuff. Just added it here for reference.
Related
I am working on developing a client-side application built on EmberJS.
Now, while I test the code in the browser ultimately, I have the following locally for development;
NodeJS & NPM
I have defined bower.json & package.json
I use ember-cli & do ember build & ember server to start the local server
I hit the URL http://localhost:4200 in the browser to access the app
Now my question is I wanted to understand, what exactly is happening here ?
Meaning what exactly happens before code runs in the browser.
I understand when the build happens, it actually pushes code into the 'dist' directory.
Is there any role in NodeJS in all of this (meaning any JS run on server-side in the background) OR we just utilize npm/bower for this case ?
So I just wanted to connect all the dots regarding running in the browser.
browsers don't support the features of modern javascript, so when you end up deploying your ember site, you only need to deploy static files (from the dist directory), and you actually don't need a server at all.
This is how https://emberclear.io works (no server, just a CDN).
The NodeJS things are purely for pre-deployment needs (development, transpiling, testing, etc).
Hope this helps.
after searching quite a lot without findind nothing about it I'm here to ask you if there is a way to implement Git in a pure Javascript web application.
I already know about Git.js but it implements just some basic things and I also wanted to build my own library to learn more in depth about Git.
What I'm not looking for is an API or a lib that could help me.
What I'm looking for is something like:
var command = {{git commit -m "Hello world"}} // Also pure git implementation
gitExecute(command);
I'm still a junior developer and maybe this could be impossible...thanks for the reply :)
What you are asking for may be difficult to do in a browser (because you will need access to the file system to run git commands). What you may need to do is create a NodeJS server which exposes REST endpoints which can be accessed by code in the browser which provides the GUI. The NodeJS server code can run commands as needed and respond to the REST HTTP requests which can be then used by your code in the browser to show/update the GUI.
The disadvantage with this method is that you will need to run your NodeJS server on the computer which has the repository and will not work if the repo is not local to the server.
Another alternative is to use the REST APIs exposed by popular GIT providers like GitHub.
EDIT:
Come to think of it, your usecase may be a good fit for an Electron App. That will allow you to build a desktop app (with access to the filesystem and privileges to execute commands) using Javascript.
For this purpose, NodeJS is mandatory.
You could install git on your server machine, and thene execute your cmds through nodejs' child processes (DOCs)
I want to set up a second node.js server to run an express.js application which is an exact and independent copy of my current html (client-side) and js (server-side) files.
The reason is that I want to deploy my current code in a production environment that can be used by the team that will not be shut down, while I work on my current code in a development environment.
My worry is that I have added my current node.js server to my path and I am not sure if upon installation of the second node.js server my command to start the second server will interfere with the node.js server I have saved in my path variable.
Here are a couple of things to know before I ask my questions:
I am working on a machine with a Linux distribution.
I am using Express.js routing
I am using the instructions to install another instance of node.js and express.js at:
www.vultr.com/docs/installing-node-js-and-express
My questions are as follows:
Is this as simple as installing node and express as per the instructions in the link above into a new directory and running from the new path without storing it in my path variable?
Is there a better and more effective way to create a production and a development environment so that my team can use the app I have built without interfering with my current instance of node while ensuring 100% up time for the app deployed in production?
Once the 2nd server is instantiated, how do I make the call from my terminal so that it does not turn on/off the original node server I have running from my path variable?
Considering that the link above is a how to on how to install node and express from scratch and in Ubuntu (I am on CentOS - Gnome), is there a better "how to" that I should use to complete the second node and express install?
When creating the new Port for the second node/express server to listen on can I just pick any number with 4 digits or is there a particular set of numbers that would be more effective to use? I am already using Port:3000 for my first instance in my development environment.
Thank you for your guidance.
Developing and serving from the same PC is not preferable, however, if you must, this is what you can do.
First, there is no need to install a second copy of node on to your machine - you can run multiple processes of node on the same machine without any problem.
What I suggest you do is this:
If you haven't already, commit your project into a git repository
Create separate branches for development and production, as shown here: http://nvie.com/posts/a-successful-git-branching-model/#the-main-branches
Every time you are ready to publish a new piece of code, push it to the master branch
Move all configuration parameters to a config file, and create s separate one for dev/production, you can do this easily with the config package: https://www.npmjs.com/package/config
Clone your repo to a separate folder which would always remain on the master (production) branch
Run you server from that folder - your team could then connect to it
All development would be done in the original folder. Once you are ready, push to master, and pull on the production folder.
Regarding the port numbers, you can use anything that is above 1024 and below 65535
This is probably a very green question, but I've been designing a react app for a while using webpack and installing various packages using npm install. Every package is for some front end widget such as tabs, or D3, etc. My question is does this mean I have to make my server a node server if and when I go production? Could it be a Flask server, or some other random type and still use these node packages? I know that seems like a stupid question because I'm using node, and they're called node modules, but they're all for the front end and not the back end, so I don't know if they require a node back end or not.
My question is does this mean I have to make my server a node server if and when I go production?
Nope. You can use whatever web server you like. WebPack is going to bundle everything up as static resources which are deployed to your server in a normal way.
In fact, you probably shouldn't be using Node.js for normal static HTTP file serving. You would have a more performant site by using something like Nginx.
NPM was poorly named, but the naming made more sense at the time it was created. Web developers can use it as a package manager as well.
I am developing ionic application and using gulp utility to minify js files.
To avoid gulp getting configured in all the systems of team members, I am planning to have remote system which will communicate with TFS, take the project and put it in some folder and then I will install gulp on that and run task accordingly.
But my question is how to make connection from remote system to TFS to get project ? I know through Eclipse i can pull and get the project but is there any independent approach like running batch file and getting things done.
Overall aim is to avoid installing run in all the team member system instead they can connect to remote system and take the minified versions.
Help is appreciated !
According to your description, you just want to get a version from TFS to the workspace on your remote machine.
There are several ways to achieve this:
Install VS/Team Explorer on the remote machine, then perform get latest or get specific version from history.
Go to TFS web portal, navigate to CODE tab, select the project, and choose Download as Zip.
Use TFS Get command to get (download) either the latest version or a specified version of one or more files or folders from Team Foundation Server to the workspace.
Syntax:
tf get [itemspec] [/version:versionspec] [/all] [/overwrite] [/force] [/remap]
[/recursive] [/preview] [/noautoresolve] [/noprompt]
[/login:username,[password]]
Write a batch script to invoke command line. Check http://n3wjack.net/2014/02/02/how-to-pull-from-tfs-from-the-command-line/