Tag: javascript

Process File Uploads In Node.js With Hapi Framework

November 10, 2017 Nic Raboy

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

Use A Router To Navigate Between Pages In A Vue.js Application

November 8, 2017 Nic Raboy

When building a modern web application, being able to navigate between pages is a necessity. Not to mention it is very important to be able to do so easily. To make this possible, frameworks such as Angular, React, and Vue use what's known as a router and a set of routes. Each possible point of navigation, or page, is a route with its own configuration.

We're going to see how to configure a set of routes and navigate between them using Vue.js and the vue-router library.

Read More

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

November 6, 2017 Nic Raboy

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 Via HTTP In A Vue.js Web Application

October 24, 2017 Nic Raboy

When building a modern web application, chances are that you'll need to consume data from some remote resource, whether it be one that you've built or something someone else built. Sending HTTP requests is one of the more popular ways to send data from client facing applications to RESTful API backends.

We're going to see how to send HTTP requests within a Vue.js web application, using a variety of techniques such as those found in the popular axios and vue-resource libraries.

Read More

Consume Remote API Data From Within A Node.js Application

October 9, 2017 Nic Raboy

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

October 6, 2017 Nic Raboy

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

Getting Familiar with Gulp for Workflow Automation

September 7, 2017 Nic Raboy

I've been developing web applications for as long as I can remember and there are certain repetitive tasks that I do between the development and deployment of each final product. For example, current web standards demand that web resources like CSS, and JavaScript be minified or images be compressed. We could easily do this by hand or with helper applications, but why would you want to?

Instead, repetitive tasks can, and should, be transformed into an automated workflow, something that is particularly useful when it comes to continuous integration and continuous deployment.

We're going to see how to create a an automated workflow using the Gulp toolkit to do simple tasks like cleaning, minification, copying, altering, and even deploying projects.

Read More