Skip to main content

SlashLogs

Tag: javascript

How to inject authorization header on all axios requests

While using a frontend client like React you often find yourself calling the backend and using the same code to give axios a JsonWebToken or an Api Key to authorize the client and fulfill the request in the backend code. Instead of passing the authorization token you can handle and instruct axios to save you from that boilerplate code. Axios is a very usefull http client library that can make a lot for us.

How to hide an email address from crawlers and bots

When we create a website, it is important to put our contact details so that we can receive correspondence from our readers or customers. The problem is that many bots or spiders (programs designed to get the text of websites automatically) often look for emails to send junk to our mailbox and sell that email to more dubious companies with large lists to send spam to our box. So how can we hide email from these bots?