Thursday, April 13, 2017
In this blog post we will setup our AngularJS SPA application for Heroku and testing it locally to make sure we got all our ducks in a row if you need a refresher for how to setup Heroku you can visit this post. By deploying to Heroku we can access our application online making our application live.
Here are the steps to deploying the AngularJS shopping application to Heroku:
1. Find out the node and npm version you have installed on your machine by typing in the following command
node --version
npm --version
the version you have installed on your machine is probably different
2. Now open the package.json file and add the lines in bold the "engines" section, which tells Heroku that our application is a Node application in the path C:\Program Files\heroku\client
{
"name": "bankapp",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node ./bin/www"
},
"engines": {
"node": ">=10.14.1",
"npm":">=6.4.1"
},
"dependencies": {
"body-parser": "~1.16.0",
"cookie-parser": "~1.4.3",
"debug": "~2.6.0",
"express": "~4.14.1",
"jade": "~1.11.0",
"morgan": "~1.7.0",
"serve-favicon": "~2.3.2"
}
}
3. We can now create the Procfile to tell Heroku how to start the application, the Procfile type in the line
web: npm start
Don't type anything else. Your application folder should look like the following now
4. Before we push it to Heroku let's test it locally with the Heroku toolbelt by typing in the command heroku local web in the root directory
Now open the browser and type http://localhost:5000
You should see the same thing on your browser
If you get to this stage that means your Heroku setup is correct and you are ready to push your application to the Heroku hosting service.
Posts In The AngularJS SPA Application Series:
Here are the steps to deploying the AngularJS shopping application to Heroku:
1. Find out the node and npm version you have installed on your machine by typing in the following command
node --version
npm --version
the version you have installed on your machine is probably different
2. Now open the package.json file and add the lines in bold the "engines" section, which tells Heroku that our application is a Node application in the path C:\Program Files\heroku\client
{
"name": "bankapp",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node ./bin/www"
},
"engines": {
"node": ">=10.14.1",
"npm":">=6.4.1"
},
"dependencies": {
"body-parser": "~1.16.0",
"cookie-parser": "~1.4.3",
"debug": "~2.6.0",
"express": "~4.14.1",
"jade": "~1.11.0",
"morgan": "~1.7.0",
"serve-favicon": "~2.3.2"
}
}
3. We can now create the Procfile to tell Heroku how to start the application, the Procfile type in the line
web: npm start
Don't type anything else. Your application folder should look like the following now
You should see the same thing on your browser
Posts In The AngularJS SPA Application Series:
- Setting Up Angular-Seed
- Preparing Angular-Seed For The Shopping List Application
- Refactor Code to Not Use Global Variables (Shopping List App)
- Installing MongoDB
- Create a MongoDB Configuration FIle
- Install mongoDB as a Windows Service
- Installing Express generator
- Installing ExpressJS Application Server
- Creating The SPA Project Folder Structure
- Setup Express To Serve Static Files
- Setup The Shopping Application For Heroku And Testing It Locally
- Deploy Shopping List Application To Heroku
- Install RoboMongo GUI for MongoDB
Subscribe to:
Post Comments (Atom)
Search This Blog
Tags
Web Development
Linux
Javascript
DATA
CentOS
ASPNET
SQL Server
Cloud Computing
ASP.NET Core
ASP.NET MVC
SQL
Virtualization
AWS
Database
ADO.NET
AngularJS
C#
CSS
EC2
Iaas
System Administrator
Azure
Computer Programming
JQuery
Coding
ASP.NET MVC 5
Entity Framework Core
Web Design
Infrastructure
Networking
Visual Studio
Errors
T-SQL
Ubuntu
Stored Procedures
ACME Bank
Bootstrap
Computer Networking
Entity Framework
Load Balancer
MongoDB
NoSQL
Node.js
Oracle
VirtualBox
Container
Docker
Fedora
Java
Source Control
git
ExpressJS
MySQL
NuGet
Blogger
Blogging
Bower.js
Data Science
JSON
JavaEE
Web Api
DBMS
DevOps
HTML5
MVC
SPA
Storage
github
AJAX
Big Data
Design Pattern
Eclipse IDE
Elastic IP
GIMP
Graphics Design
Heroku
Linux Mint
Postman
R
SSL
Security
Visual Studio Code
ASP.NET MVC 4
CLI
Linux Commands
Powershell
Python
Server
Software Development
Subnets
Telerik
VPC
Windows Server 2016
angular-seed
font-awesome
log4net
servlets
tomcat
AWS CloudWatch
Active Directory
Angular
Blockchain
Collections
Compatibility
Cryptocurrency
DIgital Life
DNS
Downloads
Google Blogger
Google Chrome
Google Fonts
Hadoop
IAM
KnockoutJS
LINQ
Linux Performance
Logging
Mobile-First
Open Source
Prototype
R Programming
Responsive
Route 53
S3
SELinux
Software
Unix
View
Web Forms
WildFly
XML
cshtml
githu
Liên hệ Aivivu, đặt vé máy bay tham khảo
ReplyDeleteVe may bay di My
vé máy bay từ mỹ về việt nam hãng korea
các chuyến bay sang nhật có bị cấm không
vé máy bay từ đức về việt nam
giá vé máy bay từ Vancouver về việt nam
Có chuyến bay từ Hàn Quốc về Việt Nam không
vé máy bay cho chuyên gia nước ngoài