Skip to main content

Posts

How to secure API token when deploying Angular application with Netlify

As you get more into front-end development, you realize that visual looks and GUI are not the most important thing. Yes, they are the most important thing for the user because it's what they first see. However, there are other equally, if not more important, application segments that a developer needs to take care of. One of them is security. This is such an important aspect that, if you don't have it covered, you can't even deploy your application and have your clients use it safely.   Consider the use of   APIs. Almost all front-end applications use APIs today. For young developers, it's encouraging to learn API implementation, because it's something they will surely use in their career. There are numerous APIs online to use freely, mostly for the purpose of learning and showcasing your work. Some of them can be found here Free API . In my previous post Using GitHub REST API to display your repositories with Angular , I wrote about GitHub API and how to fetc...
Recent posts

Using NGXS actions instead of repeating API calls

Photo by Branko Stancevic on Unsplash    When you need to send an API call , be it GET, POST or any other http request call, you can incorporate the use of State Management implementation, such as NGXS. NGXS is a state management pattern + library for Angular . It acts as a single  source of truth for your application's state, providing simple rules for  predictable  state mutations - NGXS documentation.   Here is the example of sending a GET request through a service call.   ngOnInit(): void {     this.spinnerLoading = true;     this.dataSource$ = this.postListService.getPosts();     this.getPostsData();     this.spinnerLoading = false;    }   getPostsData() {     this.dataSource$.subscribe(        ( res )...

Using GitHub REST API to display your repositories with Angular

This post covers the authentication to GitHub REST API with fine-grained personal access token, sending the request to GitHub server with Octokit library, and displaying the list of your repositories in Angular component. Instructions on how to create the token can be found in GitHub documentation and will not be covered in this post.  Photo by Douglas Lopes on Unsplash    Handling your token in Angular app Before moving any application or a page that uses sensitive information such as passwords or tokens into a production, you need to be aware that sensitive data cannot be hidden from a client (user) if it is stored in the application. The best way for production use is to serve the token from a back-end or a proxy server. There are plenty of examples on how to do that, for now we will store the token in the app, so that we can focus on authentication and pulling the data from the GitHub server. Store the token in a config file Once you have created your G...