Week 9 - Session 2 - Web APIs & Express
blog image source |
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:
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
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