Image for post
Image for post
Photo by David Pisnoy on Unsplash

This is part 4 in a four part series where we will demonstrate building a web application using Go and Vue, and finally bundle it all together in a single binary for super-easy deployment/distribution. Part 1 can be found here, part 2 here, and part 3 here.

In part 1 we built the Go and Vue apps. In part 2 we changed the Go app to automatically start the Vue app by running Node when the version of the application is “development”. In part 3 we bundled it all up into a single compiled binary. …


Image for post
Image for post
Photo by Annie Spratt on Unsplash

This is part 3 in a four part series where we will demonstrate building a web application using Go and Vue, and finally bundle it all together in a single binary for super-easy deployment/distribution. Part 1 can be found here and part 2 here.

In part 1 we built the Go and Vue apps. In part 2 we changed the Go app to automatically start the Vue app by running Node when the version of the application is “development”. In this article we are going to do the following.

  1. Build a final version of the Vue app
  2. Bundle the final Vue app into our Go…


Image for post
Image for post
Photo by Sigmund on Unsplash

This is part 2 in a four part series where we will demonstrate building a web application using Go and Vue, and finally bundle it all together in a single binary for super-easy deployment/distribution. Part 1 can be found here.

In the first part of this series we built the Go and Vue apps. The Go application is a simple HTTP server that has a single endpoint which returns the version of this application. The Vue app is the stock Vue CLI hello world, but we added code to pull the version from the Go API and display it on our page. …


Image for post
Image for post
Photo by Gift Habeshaw on Unsplash

Often I find myself tasked with building web applications or APIs with web management portals. On the backend my language of choice is Go, while on the frontend my framework of choice is Vue. One of the big benefits of Go is it compiles into a single binary. When building an API in Go, and a frontend in JavaScript though, these are two different stacks, and as such might mean deploying two different apps. And in some cases that may be desirable. …


Image for post
Image for post
Photo by Luis Villasmil on Unsplash

Disclaimer: The following statements are mine, and do not relate to my employer or any of their or my clients. This article is based on a real story, but the details have been changed to protect the original source.

As software engineers we often have a hundred things to consider aside from the code we are writing, be it testing, servers, or deployment. One area that can be easily overlooked is security. I came across the following gem one day when assisting in a security review of an application.

The application in question accepted user input, and at some point in the process would take this input and do some type of concatenation or processing with it into a variable. The security testing team reported a finding and I was asked what the following code would do. …


Image for post
Image for post
Photo by Bernd Klutsch on Unsplash

Go, commonly referred to as “Golang”, is a great language for writing RESTful service applications. Every good service application should have documentation describing its endpoints for future consumers, even if that consumer is you. Enter Swagger, one the best ways to document RESTful APIs. In this article I’ll talk about using a tool called swag to document and generate an endpoint for viewing your documentation.

Let’s start with a small, simple example application that exposes an endpoint that returns an array of values. …


Image for post
Image for post
Photo by Sai Kiran Anagani on Unsplash

I don’t know about you, but I seem to learn something new about Vim everyday. If not something new, at least a new way to use something I already knew. Macros are something I’ve known about for a little bit, but I sometimes forget to make use of their power.

Let me present an example. Let’s say I have a structure in Go that looks like the one below. Note: I’m only using Go as an example here. I’m sure what I’m about to show you can apply to any language.

In the above sample structure we have some information about a referral. From here I want to make an equivalent class in JavaScript. The final result would look like this. …


Image for post
Image for post
Photo by Kevin Ku on Unsplash

Yup. Here’s another “here’s my Vim configuration” post. These are a dime a dozen these days, as it seems “hip” to post your Vim config. That being said, as a programmer I often find it useful to see other people’s configuration, as sometimes it gives me an idea, or I learn a new trick. So, with that spirit in mind, here is my configuration.

For my Vim configuration I use Plug to manage plugins, so if you use another plugin management system, your mileage will vary. Also, I have some keybindings specific to the programming languages I spend the most time in, namely Go, Javascript, and Typescript. …


Image for post
Image for post
Photo by Claudio Hirschberger on Unsplash

It’s another work night plugging away at code. I find myself in yet another situation where I want to integrate with a 3rd party RESTful API, and I’ll need to make a LOT of API calls. I don’t want to flood their server, and I don’t want too many open TCP connections and get a nasty message about too many open files. It’s a fairly common problem. In fact, there are numerous articles on the internet which offer solutions for controlling the number of simultaneous goroutines executing work. Well… here’s another, fairly simple, naive approach.

Disclaimer! The code found here is something I wrote for some personal projects. It is not necessarily suitable for production use, so don’t go copy and paste it with abandon! …


Image for post
Image for post
Photo by Suganth on Unsplash

Recently I had a client that has a fairly large image library stored in MongoDB using GridFS. I was building them an application which provided an interface between their front-end website and their new back-office system, which provides accounting services among other things. Part of this application needed to retrieve images from this MongoDB system and stream them to the browser so their front-end website could use them.

Now, if you aren’t familiar with MongoDB, it is a document-based database with powerful querying capabilities. GridFS is a system designed for storing files larger than the 16MB limit imposed on documents in MongoDB, and it is a part of MongoDB. So, for example, if I need to define an image, it may look something like this in JSON format, which just happens to be how one works with MongoDB data (well, BSON, but let’s not get technical here). …

About

Adam Presley

Just a guy who loves his wife, kids, and writing software.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store