Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker.

Containerizing A Node.js With Express Image Processing RESTful API Using Docker

Docker is a great way to package and deploy web applications. Applications that have been containerized can easily be created, destroyed, or even moved between servers, as long as the servers are using the Docker runtime.

Not too long ago I wrote about creating a RESTful API that could process images and generate Android compliant launcher icons. This article was titled, Create an Android Launcher Icon Generator RESTful API with Node.js, and Jimp and it was powered by Express Framework. The application could be served on any properly configured server with Node.js. The catch here is that server configuration is never easy or quick.

We’re going to see how to package our web application into a container using Docker.

Read More

Create An Android Launcher Icon Generator RESTful API With Node.js, And Jimp

When you’re developing an Android mobile application, it is critical that you come up with a nice launcher icon for all possible Android screen densities. If you’re not too familiar with Android, there are mdpi, hdpi, xhdpi, xxhdpi, and xxxhdpi densities as of now. This number could change in the future.

Once you’ve got your icon, resampling or resizing it for each possible screen density can become a pain in the butt. Instead, it makes sense to use or create a script for this.

If you’ve been keeping up, you’ll remember I wrote about image generators in an article titled, Generating Splash Screens and Application Icons for NativeScript Mobile Apps. Since we’re talented developers, we’re going to create our own service this time around.

We’re going to see how to create a RESTful API that accepts an image and generates various sizes of that same image, bundled within a ZIP archive. We’re going to accomplish this task with Node.js and Express.

Read More

Manage Cross-Origin Resource Sharing In A Node With Hapi Application

To continue down my path of solving the worlds cross-origin resource sharing (CORS) problems, I wanted to adventure into Hapi, a Node.js framework that I’ve been heavily using lately. If you’re not familiar with cross-origin resource sharing, it is something that frequently comes up when you try to use front-end JavaScript to access content from another host or port.

Previously I had written about exploring CORS in an Express with Node.js application. While Express is probably the most popular framework, it certainly isn’t the only framework, which is why we’re going to take a look at CORS in Hapi.

Read More

Process File Uploads In Node.js With Hapi Framework

When building a web application, I personally find file uploads to be the most complicated part of the job. For example, how do you accept the files, and what do you do with them after you’ve received them in the request?

Not too long ago I wrote about accepting file uploads in Node.js sent via Angular. In this example I was using Express and the Multer middleware. What if you’re interested in using one of the more modern Node.js frameworks instead of Express?

This time around we’re going to explore processing file uploads with Hapi and Node.js.

Read More

Handling CORS Related Issues In An Express Framework Node.js Web Application

Proper cross-origin resource sharing (CORS) configuration is one of those things that is completely necessary when building a RESTful API, but also one of those things that is a total pain in the butt when it comes to prototyping an application. CORS related errors are common when testing a web application where the front-end JavaScript layer exists on a different port or host than the API that it tries to access.

Previously I had written about configuring cross-origin resource sharing via a Golang RESTful API, but this time we’re going to explore the same using Node.js and Express Framework.

Read More

Consume Remote API Data From Within A Node.js Application

Not too long I wrote about consuming remote API data using Golang. However, as you know, I’m also a heavy Node.js developer as well. So how do we issue HTTP requests from within a Node.js application and why might you want to. The simple answer is that you might want to consume someone else’s data within your web application and you can’t just do that like you would in a browser-based application using Ajax or similar.

We’re going to see how to make HTTP requests possible within Node.js.

Read More

Building A RESTful API With Node.js And Hapi Framework

Back when I was really getting into the swing of Node.js, I had written about creating a simple RESTful API that made use of the Express framework. Express was, and still is, one of the most popular frameworks for creating web applications with Node.js. However, this doesn’t mean it is the best solution.

Recently I’ve been hearing a lot around Hapi for Node.js. The common feedback that I hear is that it is specifically designed for creating RESTful web services making them significantly easier to create without as much boilerplate code.

We’re going to see how to create a simple API using Hapi as well as packages such as Joi for request validation.

Read More