WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
Nodejs server lesson 3
1. Building Servers with
Node.js Express
Adetunji Samuel
DSC, CDC & Creators community lead,
covenant university
@detunjisamuel ~ twitter
2. Agenda Summary
● What is the Npm and how does it work
● Http Requests and CORS
● Let’s try to use inbuilt node methods
● Finally a creating service
● Hands on
3. ● Command line tool to install, create, and
share packages of JavaScript code
written for Node.js
● inbuilt with node
● Saves packages in directory called
node_modules
● npmjs.com/
What is NPM?
12. Express Routers
● Routers are simply an endpoint of a server
● We can perform various operations on routes using HTTP
methods such as GET, POST, PUT, and DELETE
14. Express Middleware
● Functions that have access to the request object (req), the
response object (res), and the next middleware function in
the application’s request-response cycle.
● Can Execute any code.
● Can Make changes to the request and the response objects.
15. Working With Files
● Reading from file
● Creating file
● Updating file
● Delete file
17. Hands on
● Let’s fetch from already existing api
● Serve Static Assets
● Server JSON to particular route
● Send request header details back
● Save data in a file and return have route to server data