Angular Project Deployment on Live Server
Deployment
Deploy your Angular application to a remote server.
Create a production build and copy the output directory to a web server.
- Start with the production build
- Copy everything within the output folder dist/ by default.
- Configure the server to redirect requests for missing files to index.html.
Server configuration
There is no single configuration that works for every server. The following sections describe configurations for some of the most popular servers.
Apache: add a rewrite rule to the .htaccess file as shown
Nginx: use try_files, as described in Front Controller Pattern Web Apps, modified to serve index.html
IIS: add a rewrite rule to web.config, similar to the one shown here
Firebase hosting: add a rewrite rule.
The base tag
In development, you typically start the server in the folder that holds index.html. That's the root folder and you'd add near the top of index.html because / is the root of the app.
But on the shared or production server, you might serve the app from a subfolder. For example, when the URL to load the app is something like http://www.mysite.com/my/app/, the subfolder is my/app/ and you should add to the server version of the index.html.
This lesson also available on YouTube
More Posts - Angular Project Training
- Project Overview and Setup
- Bootstrap Integration
- Project Structure and Create Modules and Components
- Theme Integration and Create Home Page
- Create Routing, Navigation and Inner Page
- Service and Http Client, Blog Listing and Featured Blog
- Service and Http Client for Blog Detail, Recent Blog and Categories
- Service and Http Client for Create Static Pages
- Create Contact Form and Send Data on Email
- Login and Logout using Web API with Token Based Authentication
- CRUD #1 Admin can View Blog List
- CRUD #2 Create, Edit, and Delete Blog with File Upload
- Set HTTP Base URLs of Production and Development Environment
- Angular Project Deployment on Live Server
Angular 6/7 Tutorial in Hindi
Angular 7 is a JavaScript based framework for building web applications and apps in JavaScript, html, and TypeScript, which is a superset of JavaScript, used to create Single Page Applications.
truecodex.com provides video tutorial for enough understanding of all the necessary components of Angular 6 and Angular 7.
truecodex.com will keep uploading videos of the latest features of Angular. Please subscribe my channel for latest videos.