Skip to content

wandri/angular-firebase-deployement

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Steps to deploy an angular application with firebase hosting.

  1. Create a google account.

  2. Go to the firebase console.

  3. In the firebase console, create a new project.

    firebase init

    firebase init

    • Remember the id of the project.

    • Specify your region and validate.

  4. Install Nodejs

  5. Install angular-cli and firebase-tools.

    npm install -g @angular/cli firebase-tools
    
  6. Create a new angular project.

    ng new angular-firebase
    
  7. Build your application.

In your angular folder, build the application.

```
ng build --aot
```

It will create a dist folder with your code (The folder can be hidden by .gitignore).

  1. Log in to firebase

    firebase login
    
  2. Initialize your project

    firebase init
    

    firebase init

    firebase init host

    • Select hosting in the choice.

    • Select your project or 'don't setup a default project'

    firebase path folder

    • To the question 'What do you want to use as your public directory ?', give the path to your dist/<angular-project-name> folder.

    • To the question 'Configure as a single-page app (rewrite all urls to /index.html)?', answer 'Yes'.

    • To the question 'File angular-firebase/dist/index.html already exists. Overwrite?', answer 'No'.

  3. (Optional) default project configuration.

    If you answer 'don't setup a default project', in the file .firebaserc copy the following code with the id of the project :

    {
      "projects": {
        "default": <PROJECT_ID>
      }
    }
    
  4. Deploy to firebase

    firebase deploy
    

    The link to the application can be found directly in the terminal or in the firebase console in the hosting menu.

    firebase project id

    firebase hosting menu

About

Steps to deploy an angular application in firebase.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published