Book Image

Advanced Node.js Development

By : Andrew Mead
Book Image

Advanced Node.js Development

By: Andrew Mead

Overview of this book

Advanced Node.js Development is a practical, project-based book that provides you with all you need to progress as a Node.js developer. Node is a ubiquitous technology on the modern web, and an essential part of any web developer’s toolkit. If you're looking to create real-world Node applications, or you want to switch careers or launch a side-project to generate some extra income, then you're in the right place. This book was written around a single goal: turning you into a professional Node developer capable of developing, testing, and deploying real-world production applications. There's no better time to dive in. According to the 2018 Stack Overflow Survey, Node is in the top ten for back-end popularity and back-end salary. This book is built from the ground up around the latest version of Node.js (version 9.x.x). You'll be learning all the cutting-edge features available only in the latest software versions. This book delivers advanced skills that you need to become a professional Node developer. Along this journey you'll create your own API, you'll build a full real-time web app and create projects that apply the latest Async and Await technologies. Andrew Mead maps everything out for you in this book so that you can learn how to build powerful Node.js projects in a comprehensive, easy-to-follow package designed to get you up and running quickly.
Table of Contents (17 chapters)
Title Page
Copyright and Credits
Packt Upsell
Contributors
Preface
Index

Geolocation


In this section, you're going to start part one of a two-part series on geolocation. Instead of just sending text back and forth, we're also going to set it up so I can beam my actual coordinates, my longitude and latitude, to everyone else connected to the chat app. Then we can render a link and that link could go wherever we like; in our case, we're going to set it up to pull up a Google Maps page where the actual location of the user who sent their location is marked.

Now to actually fetch a user's location we're going to use the geolocation API, which is available in your client-side JavaScript, and it's actually a pretty well-supported API. It's available on all modern browsers, whether that's mobile or desktop, and the documentation can be found by Googling geolocation api, and looking for the MDN documentation page.

The MDN Docs, or the Mozilla Developer Network, are my favorite docs for client-side technologies, such as your web APIs, your CSS and your HTML guidelines:

Now...