When it comes to API development, there is often a need to protect certain endpoints or rate-limit the API in general. Because you are working with endpoints from clients possibly on a different domain, you can’t authenticate users with sessions and cookies. It would also be a bad idea to pass around a username and password with each request. Typically endpoints are protected with tokens that are passed with each request and these tokens are often JSON Web Tokens (JWT) that work very well.
We’re going to see how to create a very simple API using Node.js with protected endpoints that require a valid JWT in order for requests to succeed.
Read MoreIf you haven’t already gotten involved with it, you’ll probably know that TypeScript is becoming increasingly popular. Being able to use a superset of JavaScript in a typed language that compiles down to JavaScript is a great thing. However, if you’ve ever played around with TypeScript and tried to use JavaScript libraries, you’ll probably know that sometimes it can be a real pain. Often JavaScript libraries do not ship with type definitions which are critical when it comes to playing nice with TypeScript.
If you’ve been keeping up with The Polyglot Developer you’ll probably remember two posts that were created. Previously I had written about including external JavaScript libraries in an Angular application as well as adding type definitions to external JavaScript libraries in TypeScript.
We’re going to revisit these two articles and explore all the ways to include JavaScript libraries in TypeScript applications. These include applications built with NativeScript, Ionic, and Angular.
Read MoreThe recent Amazon S3 outage that took down much of the internet inspired me to talk about alternatives. Not too long ago I wrote about an open source object storage software called Minio and how I was using it on my Raspberry Pi for backups. The great thing about Minio is it shares the same APIs as AWS S3, but can be deployed to your own hardware, eliminating Amazon as a dependency.
This time around I thought it would be great to share how to use Minio as an object storage for a Node.js application that uses the middleware, Multer, for handling file uploads.
Read MoreNot too long ago you’ll remember I wrote a full stack tutorial on developing a full stack movie database with the Go programming language. In that tutorial we made use of NoSQL as the database, Golang as the backend, and Angular as the client frontend. However, I realize that not everyone is a Go developer.
This time around we’re going to take a look at developing the same full stack movie database application, but using Node.js instead of Golang. It is a good example to show that elements in the stack are modular and each element is replaceable with another technology.
Read MoreWith all the technologies and platforms available, it opens the door to infinite possibilities for development and further validates the need of being a full stack developer. There are many stacks in existence, but one of my personal favorites includes Golang, Angular, and NoSQL.
So how do you apply all these stack technologies towards a fully functional application? Let’s look at a possible usage scenario before we explore the technologies.
A problem I’ve found myself having recently is keeping track of all my movies. Can you believe I’ve purchased the same film multiple times by accident? From this spawned my need to keep a database of every movie I purchased. Using NoSQL, Angular, and the Go programming language, we can create such an application to keep track of what films we own and for what platforms.
Read MoreI’ve been hearing a lot about websockets lately and how they can accomplish real time communication between applications and servers. They act as a compliment and possible alternative to RESTful APIs that have been around for significantly longer. With websockets you can do real time messaging for things like chat, communication with IoT, gaming, and a whole lot of other things that need instant communication between clients and the server.
A while back I had played around with websockets and Node.js using a library called Socket.io, but since I’ve been really getting into Golang I wanted to explore websockets using the Go programming language.
We’re going to check out how to create a chat application where the client is an Angular application and the server is a Golang application.
Read MoreContinuing down the road of Golang development I thought it would be a cool learning example to develop a URL shortener application similar to that of TinyURL or Bitly. I think these are great examples because not only does it teach you how to develop a RESTful API that uses a datasource, but it also challenges you to think critically when it comes to the algorithms.
Previously I had written about creating a URL shortener using my other favorite server-side technology, Node.js, but the languages are so different that it makes sense to try the same with the Go programming language. In this example we’re going to create an application that makes use of Golang, Couchbase, and a few other project dependencies.
Read More