Week 9 - Session 2 - Web APIs & Express

blog image source
In computer programming, an application programming interface (API) is a set of subroutine definitions, protocols, and tools for building application software. A server-side web API is a programmatic interface consisting of one or more publicly exposed endpoints to a defined request–response message system, typically expressed in JSON or XML, which is exposed via the web—most commonly by means of an HTTP-based web server.

Web API’s - Benefits:

  • Simplified server code - not concerned with UI
  • Allows for better professional specialization
  • Separation allows server and client-side applications to evolve independently
  • Increased portability of UI components
    • Single Web API can power multiple UI's - website, mobile app etc
Express is a (relatively) lightweight server-side JavaScript framework that runs on a Node.js server, a web application can be built up in Node with the help of the HTTP module. With Express, it will take it to the next level and make apps configurable and easily extensible.
Express is the most popular Node web framework and is the underlying library for a number of other popular Node web frameworks. It provides mechanisms to:

  • Write handlers for requests with different HTTP verbs at different URL paths (routes).
  • Integrate with "view" rendering engines in order to generate responses by inserting data into templates.
  • Set common web application settings like the port to use for connecting, and the location of templates that are used for rendering the response.
  • Add additional request processing "middleware" at any point within the request handling pipeline.
While Express itself is fairly minimalist, developers have created compatible middleware packages to address almost any web development problem. There are libraries to work with cookies, sessions, user logins, URL parameters, POST data, security headers, and many more.

What is an API? In English, please - https://medium.freecodecamp.org/what-is-an-api-in-english-please-b880a3214a82

Express - http://expressjs.com/
Express/Node introduction - https://developer.mozilla.org/en-US/docs/Learn/Server-side/Express_Nodejs/Introduction

Popular posts from this blog

Week 9 to 12 - Learning with MCR Codes

Week 8 - Session 1 - JavaScript in the Browser

Week 9 - Session 1 - The Internet, the Web, HTTP