"Node.js" entries

Building APIs with Swagger

Designing and coding APIs in Node.js.

plugs

Getting an API design right demands far more than just figuring out which calls should do what. Public APIs — APIs meant to be used by people other than their creators — present a special set of challenges that can inform all API design. Even private APIs often find themselves with unexpected users, and can last far longer than was planned. Apigee faced the special challenge of creating a marquee API, an API for managing its APIs.

What comes first? The API or the code? Who is the API really for, and how important is the long-term maintenance of the API? Where does documentation fit? Answer these questions, and you can find the right approach.

Read more…

5 ways developers win with PaaS

Powering your app with open source and OpenShift

Getting Started with OpenShift As a software developer, you are no doubt familiar with the process of abstracting away unnecessary detail in code — imagine if that same principle were applied to application hosting. Say hello to Platform as a Service (PaaS), which enables you to host your applications in the cloud without having to worry about the logistics, leaving you to focus on your code. This post will discuss five ways in which PaaS benefits software developers, using the open source OpenShift PaaS by Red Hat as an example.

No More Tedious Config Tasks

Most of us don’t become developers to do system administration, but when you are running your own infrastructure you end up doing exactly that. A PaaS can take that pain away by handling pesky config and important security updates for you. As a bonus, it makes your sys admin happy too by allowing you to provision your own environment for that killer new app idea you want to tinker with, rather than nagging them for root access on a new VM.

On OpenShift, it goes like this: let’s say you decide you want to test an idea for a Java app, using Tomcat and PostgreSQL (yes, we could argue about the merits of those choices, but work with me here). You can spin that up with a one-line terminal command:

rhc app create myawesomeapp tomcat-7 postgresql-9.2 -s

That -s on the end is telling the platform to make the app auto-scaling, which I will elaborate on later; yes, that’s all it takes. RHC (Red Hat Cloud) is just a Ruby Gem wrapping calls to the OpenShift REST API. You could also use the OpenShift web console or an IDE plugin to do this, or call the API directly if that’s how you roll. The key technologies in play here are just plain old Git and SSH — there’s nothing proprietary.

Read more…

Prototype and adapt with the MEAN stack

Rapid web development with MongoDB, Express, AngularJS, and Node.js

Web development may seem like a bustling space where everything changes every 5 minutes, but, in reality, the fundamental high-level concepts of building a web application haven’t changed much since the introduction of Ajax. The libraries and concepts, like the MEAN stack, that people have built up around HTTP and browser-side JavaScript simply provide abstractions to help people build sophisticated browser-based tools more easily. However, the fundamental challenges of web development remain mostly unchanged, and the ultimate arbiter of the value of a web development framework is how easily it enables you to overcome these challenges. In this article, I’ll highlight what I believe to be the fundamental categories of web development problems, and how the MEAN stack, consisting of MongoDB, Express.js, AngularJS, and Node.js, helps you solve them.

Problem 1: Prototyping, or, how do I build the damn thing?

With the growing popularity of the lean startup model, the pressure to shorten product development cycles and churn out a prototype application quickly and cheaply has never been greater. And, as developers, we’re doing this better at an exponential rate. Projects that once required hundreds of millions of dollars of capital in the late ‘90s became projects that you could build in a month or two with a couple tens of thousands of capital at a startup accelerator around 2008. Now, these sorts of projects are being churned out at hackathons around the country in a matter of days. As great as this seems, we can do better.

Read more…

Editorial Radar with Mike Loukides & Mike Hendrickson

Discussion on machine learning, 3D printing, devices and JavaScript

In this first episode of "Editorial Radar," O'Reilly editors Mike Loukides and Mike Hendrickson discuss the important technologies they're tracking.

Editorial Radar with Mike Loukides & Mike Hendrickson

Discussion on machine learning, 3D printing, devices and JavaScript

In this first episode of "Editorial Radar," O'Reilly editors Mike Loukides and Mike Hendrickson discuss the important technologies they're tracking.

Four short links: 23 March 2012

Four short links: 23 March 2012

Caching Pages, Node NLP, Digital Native are Clueless, and Wal-Mart Loves Your Calendar

  1. Cache Them If You Can (Steve Souders) — the percentage of resources that are cacheable has increased 4% during the past year. Over that same time the number of requests per page has increased 12% and total transfer size has increased 24%.
  2. Natural — MIT-licensed general natural language facility for nodejs. Tokenizing, stemming, classification, phonetics, tf-idf, WordNet, string similarity, and some inflection are currently supported. (via Javascript Weekly)
  3. How Millennials SearchStatistically significant findings suggest that millennial generation Web searchers proceed erratically through an information search process, make only a limited attempt to evaluate the quality or validity of information gathered, and may perform some level of ‘backfilling’ or adding sources to a research project before final submission of the work. Never let old people tell you that “digital natives” actually know what they’re doing.
  4. Walmart Buys A Facebook App for Calendar Access (Ars Technica) — The Social Calendar app and its file of 110 million birthdays and other events, acquired from Newput Corp., will give Walmart the ability to expand its efforts to dig deeper into the lives of customers. Interesting to think that by buying a well-loved app, a company could get access to your Facebook details whether you Like them or not.
Four short links: 22 December 2011

Four short links: 22 December 2011

Fuzzy Text, Big Data Crime, Map Visualization, and Attacking Server-Side Javascript

  1. Fuzzy String Matching in Python (Streamhacker) — useful if you’re to have a hope against the swelling dark forces powered by illiteracy and touchscreen keyboards.
  2. The Business of Illegal Data (Strata Conference) — fascinating presentation on criminal use of big data. “The more data you produce, the happier criminals are to receive and use it. Big data is big business for organized crime, which represents 15% of GDP.”
  3. Isarithmic Maps — an alternative to chloropleths for geodata visualization.
  4. Server-Side Javascript Injection (PDF) — a Blackhat talk about exploiting backend vulnerabilities with techniques learned from attacking Javascript frontends. Both this paper and the accompanying talk will discuss security vulnerabilities that can arise when software developers create applications or modules for use with JavaScript-based server applications such as NoSQL database engines or Node.js web servers. In the worst-case scenario, an attacker can exploit these vulnerabilities to upload and execute arbitrary binary files on the server machine, effectively granting him full control over the server.
Four short links: 19 December 2011

Four short links: 19 December 2011

Version Control, Web-based ID, Mobile Design, and Node.js Tools

  1. The History of Version Control (Francis Irving) — concise history of the key advances in managing source code versions. Worth it just for the delicious apposition of “history” and “version control”.
  2. BrowserID — Mozilla’s authentication solution. BrowserID aims to provide a secure way of proving your identity to servers across the Internet, without having to create separate usernames and passwords each time. Instead of a new username, it uses your email address as your identity which allows it to be decentralized since anyone can send you an email verification message. It’s currently implemented via JavaScript but hopefully it will be built into the browser in the future. (via Nelson Minar)
  3. A Look Inside Mobile Design Patterns — Sample chapter on how different apps handle invitations, from a new [O’Reilly-published, huzzah!] book on mobile design patterns. (via David Kaneda)
  4. Node Toolbox — concise compendium of resources for node.js development.
Four short links: 13 December 2011

Four short links: 13 December 2011

Newton's Notebooks, Creative Commons, Node HTTP, and Data Business

  1. Newton’s Notebooks Digitised — wonderful for historians, professional and amateur. I love (a) his handwriting; (b) the pages full of long division that remind us what an amazing time-saver the calculator and then computer was; (c) use of “yn” for “then (the y is actually a thorn, pronounced “th”, and it’s from this that we get “ye”, actually pronounced pronounced “the”). All that and chromatic separation of light, inverse square law, and alchemical mysteries.
  2. Creative Commons Kicks Off 4.0 Round — public discussion process around issues that will lead to a new version of the CC licenses.
  3. Shred — an HTTP client library for node.js. (via Javascript Weekly)
  4. Holding Back the Age of Data (Redmonk) — Absent a market with well understood licensing and distribution mechanisms, each data negotiation – whether the subject is attribution, exclusivity, license, price or all of the above – is a one off. Very good essay into the evolution of a mature software industry into an immature data industry.
Four short links: 28 November 2011

Four short links: 28 November 2011

Ubicomp Project, Data Volumes, Yahoo! Cocktails, and Fighting Cybercrime

  1. Twine (Kickstarter) — modular sensors with connectivity, programmable in If This Then That style. (via TechCrunch)
  2. Small Sample Sizes Lead to High Margins of Error — a reminder that all the stats in the world won’t help you when you don’t have enough data to meaningfully analyse.
  3. Yahoo! Cocktails — somehow I missed this announcement of a Javascript front-and-back-end dev environment from Yahoo!, which they say will be open sourced 1Q2012. Until then it’s PRware, but I like that people are continuing to find new ways to improve the experience of building web applications. A Jobsian sense of elegance, ease, and perfection does not underly the current web development experience.
  4. UK Govt To Help Businesses Fight Cybercrime (Guardian) — I view this as a good thing, even though the conspiracy nut in me says that it’s a step along the path that ends with the spy agency committing cybercrime to assist businesses.