When I wanted to refresh my React.js skills, I quickly moved to create a dashboard of cryptocurrencies, their prices, and and other aspects of digital value. Getting rolling with React.js is a breeze — create-react-app {name}
and you’re off and running. Getting the API working isn’t quick, especially if they don’t accept cross-origin requests.
I set out to find the easiest possible Node.js proxy and I think I found it: http-proxy-middleware
; check out how easy it was to use:
// ... after `npm install express http-proxy-middleware` const express = require('express'); const { createProxyMiddleware } = require('http-proxy-middleware'); const app = express(); app.use('/coins/markets', createProxyMiddleware({ target: 'https://api.coingecko.com/api/v3/coins/markets?vs_currency=USD&order=market_cap_desc&per_page=100&page=1&sparkline=false', headers: { accept: "application/json", method: "GET", }, changeOrigin: true })); app.listen(3001);
After node server.js
is executed, I can hit http://localhost:3001/coins/markets
from my React app and receive quotes from CoinGecko’s API. Perfect!
I’m so grateful for projects like http-proxy-middleware
; they allow us to easily move past development issues and help us move forward!
CSS Filters
CSS filter support recently landed within WebKit nightlies. CSS filters provide a method for modifying the rendering of a basic DOM element, image, or video. CSS filters allow for blurring, warping, and modifying the color intensity of elements. Let’s have…
9 Mind-Blowing WebGL Demos
As much as developers now loathe Flash, we’re still playing a bit of catch up to natively duplicate the animation capabilities that Adobe’s old technology provided us. Of course we have canvas, an awesome technology, one which I highlighted 9 mind-blowing demos. Another technology available…
dat.gui: Exceptional JavaScript Interface Controller
We all love trusted JavaScript frameworks like MooTools, jQuery, and Dojo, but there’s a big push toward using focused micro-frameworks for smaller purposes. Of course, there are positives and negatives to using them. Positives include smaller JS footprint (especially good for mobile) and less cruft, negatives…
Send Email Notifications for Broken Images Using jQuery AJAX
It’s usually best to repair broken image paths as soon as possible because they can damage a website’s credibility. And even worse is having a user tell you about it. Using jQuery and PHP, you can have your page automatically notify you of broken…