Installing Ember.js on managed hosting accounts
Learn how to install Ember.js on a managed hosting account. This client-side JavaScript framework is used to create single-page applications.
Ember.js is based on the model-view-controller (MVC) architecture and provides features such as automatic template updates, application state management, and more.
Step 1: Install Node.js and npm
Section titled “Step 1: Install Node.js and npm”Ember.js requires Node.js, so the first step is to install Node.js and npm (Node.js package manager) on your account. Follow the instructions in this article for step-by-step guidance.
Step 2: Install Ember.js
Section titled “Step 2: Install Ember.js”After installing Node.js, you can install Ember.js:
- Log in to your account using SSH.
- Run the following commands:
mkdir ~/libcd ~/libnpm install ember-cli- Create a symbolic link to run Ember from any directory:
cd ~/binln -s ../lib/node_modules/ember-cli/bin/ember ember- Verify the installation:
ember --versionThis displays the Ember version installed.
Tip: To view Ember’s online help:
ember helpStep 3: Create an Ember.js application
Section titled “Step 3: Create an Ember.js application”- Create a new Ember application:
cd ~ember new testProjectThis creates an Ember application named testProject.
- Start the Ember application (choose a port between 49152 and 65535):
cd ~/testProjectJOBS=1 nohup ember server --port xxxxx &- The
&runs the command in the background. nohupensures the application continues running even after logging out.
- Configure your web server:
cd ~/public_htmlCreate or edit an .htaccess file with:
RewriteEngine OnRewriteRule ^$ http://127.0.0.1:xxxxx/ [P,L]RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule ^(.*)$ http://127.0.0.1:xxxxx/$1 [P,L]Replace xxxxx with the port number used in the previous step.
- Open your website in a browser. You should see the “Welcome to Ember” page.
Tip: If the application fails to start, the chosen port may be in use. Check nohup.out for errors, select another port, update the .htaccess file, and restart.
- To stop Ember:
pkill emberThis stops all running Node.js applications immediately.
Troubleshooting Ember.js pages
Section titled “Troubleshooting Ember.js pages”Because Ember.js runs in the browser, you can use developer tools to troubleshoot:
- Firefox: Tools → Web Developer → Web Console
- Chrome: Settings → Tools → JavaScript Console
- Internet Explorer: Settings → F12 Developer Tools → Script tab
More information
Section titled “More information”- Official Ember.js site: http://emberjs.com
- Official Ember.js documentation: http://emberjs.com/guides