This post is on how to build beautiful APIs in Node.js. Great, and what is an API? The definition says Application Programming Interface, but what does it mean? It could mean on of the few things depending on the context:
Endpoints of a service service-oriented architecture (SOA)
Class attribute and methods
The main idea is that an API is a form of a contract between two or more entities (objects, classes, concerns, etc.). Your main goal as a Node engineer is to build beautiful API so that developers who consume your module/class/service won’t be cursing and sending you hate IM and mail. The rest of your code can be ugly but the parts which are public (mean for usage by other programs, and developers) need to be conventional, extendable, simple to use and understand, and consistent.
Let’s see how to build beautiful APIs for which you can make sure other developer
I imported my AnalogDisplay component (original in React) into preact JSFiddle code, and they worked well. I can either use this.state or just state in render(). Here’s the JSFiddle code: http://jsfiddle.net/gz7L59mn/1/ and the source code:
Container technology is one of the best options for software development and deployment. It allows you to share some of the OS resources while encapsulating the code and other concerns. You can think of containers as virtual machines but with less footprint.
Containers are great for micro services where you replace monoliths with many services. Each of them works in isolation and communicates with other services via a well defined interface (typically REST).
Docker is one of the most popular implementations of containers. Docker’s What is Docker? page has a a neat comparison of containers with VMs. In a nutshell, VMs use hypervisor and each VM has it’s own OS while containers share OS and only separate libraries, bin, executables, etc.
This project will guide you through building an autocomplete function similar to the one that you might see in Slack (a popular messaging app), as shown in figure 1, when you type something in the search box. For simplicity, our widget will work with room names (the rooms in a chat application).
The autocomplete widget will have (figure 2):
An input field
A list of options filtered according to the entered characters
An Add button (figure 3)
The filtering of the matches will be done using the entered characters as the first characters of the option. In other words, there is a simple comparison that allows us to autocomplete the name of the room (figure X). For example, if you type “mac” and you have “Mac OS X” and “Apple Mac,” then only “Mac OS X” will be shown as a match, not both options.
I’ve spoken at over a dozen conferences this year and seen my share of bad presentations. Yes, for the most part geeks aren’t expected to be great at public speaking. That’s why they called geeks.
However, I noticed certain patterns: most of the times presenters were making it harder for the audience to get their material. They were doing some easy to fix things which hampered their delivery greatly. The tech talks are boring anyway (generally speaking). Why make it even hard on your listeners?
If you need to present soon at a conference (even if you are not a geek or techie), here are 10 sins you should never do when you give a conference talk (more of a note to myself than anything else):
I went to Node Interactive Europe which happened in September in Amsterdam, the official Node conference—the real deal. Organizers invited me to present on React, so I taught a workshop on Universal Web, and also participated on a panel discussion about containers and Node with folks from nearFrom, IBM, Zeit and Netflix. You should watch the panel recording on YouTube. It was a good one.
In this book, I’ll introduce you to React Native for native mobile iOS and Android development… and do it quickly. We’ll cover topics such as
Why React Native is Awesome
Setting up React Native Development for iOS
Hello World and the React Native CLI
Styles and Flexbox
Main React Native UI components
Importing Modules into an Xcode Project
Project: Weather App
This book is about getting started with React quickly and not about React Native, which is technically a separate library (or some might even call it a framework). But I figured after eight chapters of working with React for web development, it would be fun to apply our knowledge to mobile development by leveraging this awesome library. You’ll be amazed how many React Native skills you already know from React.
In the previous post, we learned how to perform HTTP/2 server push in a Node server. We also covered the benefits of server push there so to avoid duplication we won’t list them here. We used spdy for server push and H2. But most of the times Node developers don’t work with core HTTP server, they use a framework like Express. So let’s see how we can implement server push in Express.