Tag: javascript

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

Unit Testing a Node.js Application with the Jasmine Testing Framework

August 24, 2017 Nic Raboy

When building an application, regardless if it is mobile, web, or neither, it is a good idea to come up with a collection of tests that can be used in a continuous integration scenario. I must admit, I don’t have the best habits when it comes to writing tests, but I’m sure my applications would be significantly better if I did.

Previously I had written about unit testing in Golang as well as unit testing in NativeScript with Angular. This time around it makes sense to talk about writing tests in Node.js, another technology that I have in my tool belt.

Read More