Posts

Showing posts from December, 2025

Experiment 6: ExpressJS – Routing, HTTP Methods, Middleware

  6 Experiment 6: ExpressJS – Routing, HTTP Methods, Middleware Write a program to define a route, Handling Routes, Route Parameters, Query Parameters and URL building.  Below is a simple Express.js program that demonstrates: Defining routes Handling routes Route parameters Query parameters URL building 1. Install Express open command prompt mkdir abc cd abc npm init -y npm install express 2: Create app.js   ( Simple program to start with) notepad app.js                       const express = require('express'); const app = express(); app.get('/', (req, res) => {     res.send('Express routing working!'); }); app.listen(3000, () => {     console.log('Server running on http://localhost:3000'); }); save and close. 3: Run Server node app.js Open browser: type link or url :            http://localhost:3000   to see output ROUTING AND QUER...

3-5 Experiment

3-5: Augmented Programs: (Any 2 must be completed from Experiment 3-5)  1. Write a CSS program, to apply 2D and 3D transformations in a web page Using CSS Classes inline Approach 2. A web page with new features of HTML5 and CSS3.  Colour picker Date Picker, Iframe, Audio, Video like 3. Design a to-do list application using JavaScript.  Include To -do list in Software Engineering 1. Requirements gathering 2. High level design 3. Low level Design  4.  Coding/ Programming 4. Quality assurance. 5. Deployment 

Arrow Function

  // Regular Function const addRegular2 = function(a, b) {   return a + b; }; // Arrow Function (concise) const addRegular1 = (a, b) => a + b; // Implicit return console.log(addArrow1(2, 3)); // 5

Type Script 2

 Steps to compile and run Typescript tsc helloworld.ts tsc command is a typescript compiler  tsc command outputs helloworld.js run helloworld.js  node helloworld.js

Experiment 2: Typescript

 Write a program to understand simple and special types. Simple Types Simple types define basic kinds of data. // Simple Types in TypeScript let isStudent : boolean = true ; // boolean type let age : number = 20 ; // number type let studentName : string = "Ravi" ; // string type console . log ( "Is Student:" , isStudent); console . log ( "Age:" , age); console . log ( "Name:" , studentName); Special Types Special types provide flexibility or strict control over data. any Type Allows any type of value (no type checking). let data : any ; data = 10 ; console . log (data); data = "Hello" ; console . log (data); data = true ; console . log (data); o/p: ---- Simple Types ---- Is Student: true Age: 20 Name: Ravi ---- Special Type : any ---- Data (number): 10 Data (string): Hello Data (boolean): true Write a program to understand function parameters and return types. // 1. Function with required parameters ...