Bound Packages, OpenWhisk, and Web Actions

Hey folks, this is just a warning to other users in case they run into the same issue I did. As you (may) know, OpenWhisk supports the idea of packages. Packages let you organize actions into a cohesive unit, much like packages in other languages/platforms. Packages can also have default parameters that apply to every action in the package. Packages can also be shared, which makes them callable by other users.

Read more

An Example of How I Dig Into Your Code

Like most web developers (or some of you I hope), from time to time I’ll open up dev tools on a page and take a look at what’s going on behind the scenes. This morning I was drinking my coffee, waking my sick butt up (allergies - never really been a problem before, but this year decided to go all epic on me), when I got an email about an update to a bug I had filed for ColdFusion.

Read more

Using Device Motion on the Web

I’m currently working on an article for TDN that looks at how web standards have advanced in comparison to the default list of plugins supported for Apache Cordova. In my research, I looked at the Device Orientation API. Specifically, I was interested in device motion. For Cordova, motion and orientation are split into two plugins, but spec-wise, they are covered in - well - one spec. In general, it is a fairly simply API to use.

Read more

Updating Your OpenWhisk CLI

This is just a quick reminder that the OpenWhisk CLI tool updates often, and unfortunately, doesn’t provide a warning when it has become out of date. I’ve yet to see things break, of course, but obviously as a developer you want to ensure you have the latest and greatest installed. First - you can get information about your install by running wsk property get: You can see the CLI version highlighted above.

Read more

Integrating HTML Templating with OpenWhisk Web Actions

As always, when I blog about stuff like this, I want to remind folks I’m both new to serverless and new to OpenWhisk, so while what follows works, I’m not necessarily saying it is the best way to do things, or even a good idea. But let’s be honest, that’s never stopped me before, right? So the question I had this morning was - given an OpenWhisk action built for Web Action support, how would you make use of a templating engine to help return an HTML-based response?

Read more

Artificially Delaying Providers with Observable.Delay

I’m still - grudgingly - making use of Observables in Ionic 2. As I’ve said before, I don’t see anything wrong with Observables, I just find them overly complex and a pain to use. Half the time I get them working right it’s because I’ve copied and pasted another example. I would say - easily - that out of all the changes with Ionic and Angular 2 (sorry, 4, um, whatever) it’s Observables that I’ve had the hardest time adopting.

Read more

Enabling CORS for an OpenWhisk Web Action

Here’s a quick tip for you. If you are building an OpenWhisk action you plan on exposing as a web action, most likely you’ll want to look into enabling CORS so you can call your code from JavaScript on the front-end. Since Web Actions can return both a result and headers, this is trivial to do. Here is a simple example. function main(args) { if(!args.name) args.name = ‘Nameless’; let result = { string:‘Hello ‘+args.

Read more

OpenWhisk, Serverless, and Security - a POC

Before I begin, I want to be clear that what follows is a proof of concept. It should absolutely not be considered a recommendation, but rather a starting point for conversation. I’ve been thinking a lot lately about how one could use OpenWhisk along with a security model of some sort. Specifically, “Expose action so and so but only for authorized users.” Obviously “security” can imply a lot more, but in this initial post I’m going to keep my requirements a bit simpler.

Read more

PSA for New Web Developers - Don't Use file://

If you are new to web development, one of the things you may try is simply opening a local file with your web browser. In other words, you make a file, like cat.html, save it to your desktop, then do a File/Open in your browser to view it: This is a common way to learn web development and it’s even what Mozilla Developer Network suggests in its Learning Web Development tutorial.

Read more

A Tip for Zipped Actions and Packages in OpenWhisk

Just a quick tip to share today. I talked about zipped actions a few months ago. It’s how you handle adding non-supported npm modules with OpenWhisk. While OpenWhisk supports a good set of common/popular npm modules out of the box, if you want to use one that isn’t on that list, you: Make a zip of the action code, the package.json file, and the node_modules. Update your action and point to the zip instead of just the .

Read more