logo
Wrong email address or username
Wrong email address or username
Incorrect verification code
back to top
Search tags: angularjs-development-services
Load new posts () and activity
Like Reblog Comment
text 2020-04-14 11:18
How use proxy to handle http calls in Angular 8?

 

 

Hi guys, today we will learn about how we can use proxy to handle http calls in Angular 8.

So, firstly we will make a new Angular app with the cli command:

 

ng new angular-proxy

 

If you don’t know how to start with a Angular app then you can read my story, here is the link:

 

Setup Angular App with GitHub

 

Hi, today we will talk about how you can set up your angular app with git hub repository and track version control with…

 
 

Now, we have setup our app and this is the time to add httpClient to make http calls. We will do this in app.module.ts

 

The first view of app.module.ts will be look like this:-

 

And here is the updated view with HttpClient:

 

here you can see that we have added HttpClientModule.

 

The 2nd step is to we will make a normal http call to test and for that we will add a test button in app.component.

 

The updated code of app.component.html:

 

<div style="text-align:center"><h1>Welcome to {{ title }}!</h1><button (click)="makeHttpCall()">Test Call</button><router-outlet></router-outlet>

And in app.component.ts we will make a function to do call with a fake rest api:-

 

 

Here You can see that we have a get call with a fake api url. Now this is the time to test this . Our app is looking like this.

 

 

Now, well open network panel to check the network calls and hit a click on Test Call button.

 

Here you can see that Request URL is the which we have added in the function and we are getting status 200.


Now, this is the time to use proxy for this http call and for that we will make a new file named proxy.conf.json with parallel to node modules folder.

 

In the image you can see that target is the same url which we have used before.

 

So, according to proxy concept we will make http calls to this proxy “api” and the proxy file will hit its target url but the original url will not show in the network.

 

So, we will do some changes in the function:

 

makeHttpCall(){
this.httpClient.get('api').subscribe(res=>{
console.log(res);
})
}

You can see that we have changed the url to “api”.

This is the time run the project with proxy and for that we will run this command:

ng serve --proxy-config proxy.conf.json

 

This command will run the project with proxy.

 

Now we will test again with hit the button:

 

Here you can see that request url is changed and now it is hitting on http://localhost:4200/api but well get the same response with the original api.

So guys, that’s all for now. If you have any queries then you can ask me in the comment box.

 

Thank you…

 

 

Source: medium.com/@abhishek.garg_53728/use-proxy-with-angular-8-7e6e024b93b1
Like Reblog Comment
text 2020-02-25 05:47
Why RoR Web Development Is Good Choice for Back-End Development

 

There are seven hundred plus programming languages in the world; selecting the right technology in which you can develop your web application is a difficult task. Especially if you are a startup company, adopting perfect technology is quite a challenging task that every business owner faces. If you make the right decision, you can expand your business and increase productivity.  

 

Thus to overcome this difficulty, many organizations are now choosing Ruby on Rails for their back end development. RoR is a popular framework for application development that offers high-quality techniques and methods, and it would be easy to maintain code as compared to other frameworks. Hence, many developers believe that Ruby on Rails is an excellent choice to build products like e-commerce sites, social networking sites, and many more.

 

Ruby On Rails Is Ideal For Startups

 

Many modern web applications are built in Ruby. As a startup owner, your main purpose is to get more website traffic, and you may opt for an option that saves the cost. RoR makes your development process faster. It means you can save money that can be invested somewhere else, like marketing and research activities. Well, known startups like Airbnb, Github, and Dribble use Ruby on Rails framework to develop their application.

 

The key feature of Ruby on Rails development is an easy configuration process. It means the programmer doesn't have to spend time configuring files that make the development process faster and easier.

 

Another attractive feature is Ruby provides a combo of perfect tooling and better quality code library that made Rails a favorite choice for a designer too. The majority of the designers know how to work with Rails, and it would be helpful when you hire a new development team for a project, they can jump and start coding right away.

 

For example, if you want to launch an e-learning platform like Slideshare, an angularjs development company, will work for you using front-end in angular and back-end development with Ruby on Rails.

 

Ruby On Rails Used For

 

You can use RoR for your eCommerce website solution. We can not forget the famous site Shopify built with this framework as it offers multiple tools for product customizations.

 

If you want to develop any SaaS-based web application, then Ruby on Rails development is highly recommended. We have a great example that is Zendesk.

 

Apart from this, live streaming music and series sites, payment sites are developed with the RoR framework.

 

Thus we can say that Ruby on Rails is the most popular cross-platform used by all industries as it can develop applications fast with a lower budget.

 

Summery

 

Thus, Ruby on Rails is a popular and perfect choice for many developers. It has become the primary option to develop a web application. It is a highly professional open source and a cost-effective business solution for companies. By using Ruby on Rails, developers can develop an app quickly than other developing languages. 

More posts
Your Dashboard view:
Need help?